summaryrefslogtreecommitdiffstats
path: root/tests/run-make/wasm-override-linker
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/wasm-override-linker')
-rw-r--r--tests/run-make/wasm-override-linker/Makefile13
-rw-r--r--tests/run-make/wasm-override-linker/foo.rs6
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/run-make/wasm-override-linker/Makefile b/tests/run-make/wasm-override-linker/Makefile
new file mode 100644
index 000000000..52339f926
--- /dev/null
+++ b/tests/run-make/wasm-override-linker/Makefile
@@ -0,0 +1,13 @@
+# needs-matching-clang
+
+include ../tools.mk
+
+ifeq ($(TARGET),wasm32-unknown-unknown)
+all:
+ $(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG)
+else ifeq ($(TARGET),wasm64-unknown-unknown)
+all:
+ $(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG)
+else
+all:
+endif
diff --git a/tests/run-make/wasm-override-linker/foo.rs b/tests/run-make/wasm-override-linker/foo.rs
new file mode 100644
index 000000000..f4167a4fc
--- /dev/null
+++ b/tests/run-make/wasm-override-linker/foo.rs
@@ -0,0 +1,6 @@
+#![crate_type = "cdylib"]
+
+#[no_mangle]
+pub extern "C" fn add(a: i32, b: i32) -> i32 {
+ a + b
+}