]> git.lizzy.rs Git - rust.git/blob - tests/codegen/target-cpu-on-functions.rs
Rollup merge of #107248 - erikdesjardins:addrspace, r=oli-obk
[rust.git] / tests / codegen / target-cpu-on-functions.rs
1 // This test makes sure that functions get annotated with the proper
2 // "target-cpu" attribute in LLVM.
3
4 // no-prefer-dynamic
5 //
6 // compile-flags: -C no-prepopulate-passes -C panic=abort -C linker-plugin-lto -Cpasses=name-anon-globals
7
8 #![crate_type = "staticlib"]
9
10 // CHECK-LABEL: define {{.*}} @exported() {{.*}} #0
11 #[no_mangle]
12 pub extern "C" fn exported() {
13     not_exported();
14 }
15
16 // CHECK-LABEL: ; target_cpu_on_functions::not_exported
17 // CHECK-NEXT: ; Function Attrs:
18 // CHECK-NEXT: define {{.*}}() {{.*}} #0
19 fn not_exported() {}
20
21 // CHECK: attributes #0 = {{.*}} "target-cpu"="{{.*}}"