]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/wasm-custom-sections-opt/foo.rs
Rollup merge of #67005 - andrewbanchich:master, r=joshtriplett
[rust.git] / src / test / run-make / wasm-custom-sections-opt / foo.rs
1 #![crate_type = "cdylib"]
2 #![deny(warnings)]
3
4 #[link_section = "foo"]
5 pub static A: [u8; 2] = [1, 2];
6
7 // make sure this is in another CGU
8 pub mod another {
9     #[link_section = "foo"]
10     pub static FOO: [u8; 2] = [3, 4];
11
12     pub fn foo() {}
13 }
14
15 #[no_mangle]
16 pub extern fn foo() {
17     // This will import `another::foo` through ThinLTO passes, and it better not
18     // also accidentally import the `FOO` custom section into this module as
19     // well
20     another::foo();
21 }