Skip to content

Commit 6318db1

Browse files
committed
Add test case for wasm non-clash.
1 parent a2cd91c commit 6318db1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// check-pass
2+
#![crate_type = "lib"]
3+
4+
#[cfg(target_arch = "wasm32")]
5+
mod wasm_non_clash {
6+
mod a {
7+
#[link(wasm_import_module = "a")]
8+
extern "C" {
9+
pub fn foo();
10+
}
11+
}
12+
13+
mod b {
14+
#[link(wasm_import_module = "b")]
15+
extern "C" {
16+
pub fn foo() -> usize;
17+
// #79581: These declarations shouldn't clash because foreign fn names are mangled
18+
// on wasm32.
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)