summary refs log tree commit diff
path: root/src/test/run-make/static-nobundle/Makefile
blob: abc32d4423b05a8ffb01d12977c78592a8ffd394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-include ../tools.mk

# aaa is a native static library
# bbb is a rlib
# ccc is a dylib
# ddd is an executable

all: $(call NATIVE_STATICLIB,aaa)
	$(RUSTC) bbb.rs --crate-type=rlib

	# Check that bbb does NOT contain the definition of `native_func`
	nm $(TMPDIR)/libbbb.rlib | $(CGREP) -ve "T _*native_func"
	nm $(TMPDIR)/libbbb.rlib | $(CGREP) -e "U _*native_func"

	# Check that aaa gets linked (either as `-l aaa` or `aaa.lib`) when building ccc.
	$(RUSTC) ccc.rs -C prefer-dynamic --crate-type=dylib -Z print-link-args | $(CGREP) -e '-l[" ]*aaa|aaa\.lib'

	# Check that aaa does NOT get linked when building ddd.
	$(RUSTC) ddd.rs -Z print-link-args | $(CGREP) -ve '-l[" ]*aaa|aaa\.lib'

	$(call RUN,ddd)