]>
git.proxmox.com Git - rustc.git/blob - tests/codegen/cf-protection.rs
1 // Test that the correct module flags are emitted with different control-flow protection flags.
3 // revisions: undefined none branch return full
4 // needs-llvm-components: x86
5 // [undefined] compile-flags:
6 // [none] compile-flags: -Z cf-protection=none
7 // [branch] compile-flags: -Z cf-protection=branch
8 // [return] compile-flags: -Z cf-protection=return
9 // [full] compile-flags: -Z cf-protection=full
10 // compile-flags: --target x86_64-unknown-linux-gnu
12 #![crate_type = "lib"]
13 #![feature(no_core, lang_items)]
19 // A basic test function.
23 // undefined-NOT: !"cf-protection-branch"
24 // undefined-NOT: !"cf-protection-return"
26 // none-NOT: !"cf-protection-branch"
27 // none-NOT: !"cf-protection-return"
29 // branch-NOT: !"cf-protection-return"
30 // branch: !"cf-protection-branch", i32 1
31 // branch-NOT: !"cf-protection-return"
33 // return-NOT: !"cf-protection-branch"
34 // return: !"cf-protection-return", i32 1
35 // return-NOT: !"cf-protection-branch"
37 // full: !"cf-protection-branch", i32 1
38 // full: !"cf-protection-return", i32 1