mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 08:53:35 +00:00
Add test case for wasm non-clash.
This commit is contained in:
parent
a2cd91ceb0
commit
6318db1c5a
21
src/test/ui/lint/clashing-extern-fn-wasm.rs
Normal file
21
src/test/ui/lint/clashing-extern-fn-wasm.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// check-pass
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod wasm_non_clash {
|
||||
mod a {
|
||||
#[link(wasm_import_module = "a")]
|
||||
extern "C" {
|
||||
pub fn foo();
|
||||
}
|
||||
}
|
||||
|
||||
mod b {
|
||||
#[link(wasm_import_module = "b")]
|
||||
extern "C" {
|
||||
pub fn foo() -> usize;
|
||||
// #79581: These declarations shouldn't clash because foreign fn names are mangled
|
||||
// on wasm32.
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user