about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
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