]> git.lizzy.rs Git - rust.git/blob - tests/codegen/no-jump-tables.rs
Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8Ki
[rust.git] / tests / codegen / no-jump-tables.rs
1 // Test that the `no-jump-tables` function attribute are (not) emitted when
2 // the `-Zno-jump-tables` flag is (not) set.
3
4 // revisions: unset set
5 // needs-llvm-components: x86
6 // compile-flags: --target x86_64-unknown-linux-gnu
7 // [set] compile-flags: -Zno-jump-tables
8
9 #![crate_type = "lib"]
10 #![feature(no_core, lang_items)]
11 #![no_core]
12
13 #[lang = "sized"]
14 trait Sized {}
15
16 #[no_mangle]
17 pub fn foo() {
18     // CHECK: @foo() unnamed_addr #0
19
20     // unset-NOT: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} }
21     // set: attributes #0 = { {{.*}}"no-jump-tables"="true"{{.*}} }
22 }