]> git.proxmox.com Git - rustc.git/blob - src/test/codegen/target-cpu-on-functions.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / 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"="{{.*}}"