summaryrefslogtreecommitdiffstats
path: root/tests/run-make/wasm-symbols-different-module/foo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/wasm-symbols-different-module/foo.rs')
-rw-r--r--tests/run-make/wasm-symbols-different-module/foo.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/run-make/wasm-symbols-different-module/foo.rs b/tests/run-make/wasm-symbols-different-module/foo.rs
new file mode 100644
index 000000000..a4ba7e714
--- /dev/null
+++ b/tests/run-make/wasm-symbols-different-module/foo.rs
@@ -0,0 +1,23 @@
+#![crate_type = "cdylib"]
+
+mod a {
+ #[link(wasm_import_module = "a")]
+ extern "C" {
+ pub fn foo();
+ }
+}
+
+mod b {
+ #[link(wasm_import_module = "b")]
+ extern "C" {
+ pub fn foo();
+ }
+}
+
+#[no_mangle]
+pub fn start() {
+ unsafe {
+ a::foo();
+ b::foo();
+ }
+}