]> git.lizzy.rs Git - rust.git/blob - tests/codegen/tune-cpu-on-functions.rs
Rollup merge of #107756 - RalfJung:miri-out-of-addresses, r=oli-obk
[rust.git] / tests / codegen / tune-cpu-on-functions.rs
1 // This test makes sure that functions get annotated with the proper
2 // "tune-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 -Z tune-cpu=generic
7
8 #![crate_type = "staticlib"]
9
10 // CHECK-LABEL: define {{.*}} @exported() {{.*}} #0
11 #[no_mangle]
12 pub extern fn exported() {
13     not_exported();
14 }
15
16 // CHECK-LABEL: ; tune_cpu_on_functions::not_exported
17 // CHECK-NEXT: ; Function Attrs:
18 // CHECK-NEXT: define {{.*}}() {{.*}} #0
19 fn not_exported() {}
20
21 // CHECK: attributes #0 = {{.*}} "tune-cpu"="{{.*}}"