2021-09-11 00:34:09 +00:00
|
|
|
# Test the behavior of #[link(.., kind = "raw-dylib")] and #[link_ordinal] on windows-msvc
|
|
|
|
|
2021-11-01 22:49:58 +00:00
|
|
|
# only-windows
|
2021-09-11 00:34:09 +00:00
|
|
|
|
2022-08-23 00:00:00 +00:00
|
|
|
include ../../run-make-fulldeps/tools.mk
|
2021-09-11 00:34:09 +00:00
|
|
|
|
|
|
|
all:
|
2022-07-01 20:01:41 +00:00
|
|
|
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
|
|
|
|
$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
|
2021-09-11 00:34:09 +00:00
|
|
|
$(call COMPILE_OBJ,"$(TMPDIR)"/exporter.obj,exporter.c)
|
2021-11-01 22:49:58 +00:00
|
|
|
ifdef IS_MSVC
|
2022-07-01 20:01:41 +00:00
|
|
|
$(CC) "$(TMPDIR)"/exporter.obj exporter.def -link -dll -out:"$(TMPDIR)"/exporter.dll -noimplib
|
2021-11-01 22:49:58 +00:00
|
|
|
else
|
|
|
|
$(CC) "$(TMPDIR)"/exporter.obj exporter.def -shared -o "$(TMPDIR)"/exporter.dll
|
|
|
|
endif
|
2021-09-11 00:34:09 +00:00
|
|
|
"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
|
|
|
|
|
|
|
|
ifdef RUSTC_BLESS_TEST
|
|
|
|
cp "$(TMPDIR)"/output.txt output.txt
|
|
|
|
else
|
|
|
|
$(DIFF) output.txt "$(TMPDIR)"/output.txt
|
|
|
|
endif
|