]> git.proxmox.com Git - rustc.git/blame - src/test/run-make/wasm-custom-sections-opt/foo.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / run-make / wasm-custom-sections-opt / foo.rs
CommitLineData
8faf50e0
XL
1#![crate_type = "cdylib"]
2#![deny(warnings)]
0531ce1d 3
8faf50e0
XL
4#[link_section = "foo"]
5pub static A: [u8; 2] = [1, 2];
0531ce1d 6
8faf50e0
XL
7// make sure this is in another CGU
8pub mod another {
9 #[link_section = "foo"]
10 pub static FOO: [u8; 2] = [3, 4];
0531ce1d 11
8faf50e0 12 pub fn foo() {}
0531ce1d
XL
13}
14
8faf50e0
XL
15#[no_mangle]
16pub 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();
54a0048b 21}