]> git.lizzy.rs Git - rust.git/blob - src/test/codegen-units/item-collection/asm-sym.rs
Rollup merge of #105064 - notriddle:notriddle/main-min-width, r=GuillaumeGomez
[rust.git] / src / test / codegen-units / item-collection / asm-sym.rs
1 // needs-asm-support
2 // compile-flags: -Ccodegen-units=1 -Zprint-mono-items=lazy --crate-type=lib
3
4 #[inline(always)]
5 pub unsafe fn f() {
6     //~ MONO_ITEM static f::S @@ asm_sym-cgu.0[External]
7     static S: usize = 1;
8     //~ MONO_ITEM fn f::fun @@ asm_sym-cgu.0[External]
9     fn fun() {}
10     core::arch::asm!("/* {0} {1} */", sym S, sym fun);
11 }
12
13 //~ MONO_ITEM fn g @@ asm_sym-cgu.0[External]
14 pub unsafe fn g() {
15     //~ MONO_ITEM static g::S @@ asm_sym-cgu.0[Internal]
16     static S: usize = 2;
17     //~ MONO_ITEM fn g::fun @@ asm_sym-cgu.0[Internal]
18     fn fun() {}
19     core::arch::asm!("/* {0} {1} */", sym S, sym fun);
20 }