about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMateusz Mikuła <mati865@gmail.com>2020-07-03 21:00:14 +0200
committerMateusz Mikuła <mati865@gmail.com>2020-07-29 14:19:58 +0200
commit87abd656dabdb97758413b7f4be5bda9be71e26e (patch)
treee4a789be4552d92478db7cadfb969bed6355b439 /src
parentdb9a84a1af8bd5cea3738833c0e8cd4e1bee3f7d (diff)
downloadrust-87abd656dabdb97758413b7f4be5bda9be71e26e.tar.gz
rust-87abd656dabdb97758413b7f4be5bda9be71e26e.zip
Add test for #50176
Diffstat (limited to 'src')
-rw-r--r--src/test/run-make-fulldeps/mingw-export-call-convention/Makefile9
-rw-r--r--src/test/run-make-fulldeps/mingw-export-call-convention/foo.rs4
-rw-r--r--src/test/run-make-fulldeps/tools.mk1
3 files changed, 14 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/mingw-export-call-convention/Makefile b/src/test/run-make-fulldeps/mingw-export-call-convention/Makefile
new file mode 100644
index 00000000000..4a60059cc54
--- /dev/null
+++ b/src/test/run-make-fulldeps/mingw-export-call-convention/Makefile
@@ -0,0 +1,9 @@
+include ../tools.mk
+
+# only-windows-gnu
+
+all:
+	$(RUSTC) foo.rs
+	# FIXME: we should make sure __stdcall calling convention is used here
+	# but that only works with LLD right now
+	nm -g "$(call IMPLIB,foo)" | $(CGREP) bar
diff --git a/src/test/run-make-fulldeps/mingw-export-call-convention/foo.rs b/src/test/run-make-fulldeps/mingw-export-call-convention/foo.rs
new file mode 100644
index 00000000000..1fec00311ef
--- /dev/null
+++ b/src/test/run-make-fulldeps/mingw-export-call-convention/foo.rs
@@ -0,0 +1,4 @@
+#![crate_type = "cdylib"]
+
+#[no_mangle]
+pub extern "system" fn bar() {}
diff --git a/src/test/run-make-fulldeps/tools.mk b/src/test/run-make-fulldeps/tools.mk
index 04bf78ed210..381f14a0d38 100644
--- a/src/test/run-make-fulldeps/tools.mk
+++ b/src/test/run-make-fulldeps/tools.mk
@@ -48,6 +48,7 @@ ifdef IS_MSVC
 STATICLIB = $(TMPDIR)/$(1).lib
 STATICLIB_GLOB = $(1)*.lib
 else
+IMPLIB = $(TMPDIR)/lib$(1).dll.a
 STATICLIB = $(TMPDIR)/lib$(1).a
 STATICLIB_GLOB = lib$(1)*.a
 endif