]> git.proxmox.com Git - rustc.git/blob - tests/run-make/raw-dylib-inline-cross-dylib/Makefile
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / run-make / raw-dylib-inline-cross-dylib / Makefile
1 # Regression test for calling an inline function that uses a raw-dylib function.
2
3 # only-windows
4
5 include ../../run-make-fulldeps/tools.mk
6
7 all:
8 $(RUSTC) --crate-type dylib --crate-name raw_dylib_test lib.rs -C prefer-dynamic
9 $(RUSTC) --crate-type dylib --crate-name raw_dylib_test_wrapper lib_wrapper.rs -C prefer-dynamic
10 $(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)" -C prefer-dynamic
11 # Make sure we don't find an import to the functions we expect to be inlined.
12 "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -v -e "inline_library_function"
13 "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -v -e "inline_library_function_calls_inline"
14 # Make sure we do find an import to the functions we expect to be imported.
15 "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -e "library_function"
16 $(call COMPILE_OBJ,"$(TMPDIR)"/extern_1.obj,extern_1.c)
17 $(call COMPILE_OBJ,"$(TMPDIR)"/extern_2.obj,extern_2.c)
18 ifdef IS_MSVC
19 $(CC) "$(TMPDIR)"/extern_1.obj -link -dll -out:"$(TMPDIR)"/extern_1.dll -noimplib
20 $(CC) "$(TMPDIR)"/extern_2.obj -link -dll -out:"$(TMPDIR)"/extern_2.dll -noimplib
21 else
22 $(CC) "$(TMPDIR)"/extern_1.obj -shared -o "$(TMPDIR)"/extern_1.dll
23 $(CC) "$(TMPDIR)"/extern_2.obj -shared -o "$(TMPDIR)"/extern_2.dll
24 endif
25 $(call RUN,driver) > "$(TMPDIR)"/output.txt
26
27 ifdef RUSTC_BLESS_TEST
28 cp "$(TMPDIR)"/output.txt output.txt
29 else
30 $(DIFF) output.txt "$(TMPDIR)"/output.txt
31 endif