11// Test that the correct module flags are emitted with different branch protection flags.
22
3- // revisions: bti pac-ret leaf b-key
3+ // revisions: BTI PACRET LEAF BKEY NONE
44// min-llvm-version: 12.0.0
55// needs-llvm-components: aarch64
6- // [bti ] compile-flags: -Z branch-protection=bti
7- // [pac-ret ] compile-flags: -Z branch-protection=pac-ret
8- // [leaf ] compile-flags: -Z branch-protection=pac-ret,leaf
9- // [b-key ] compile-flags: -Z branch-protection=pac-ret,b-key
6+ // [BTI ] compile-flags: -Z branch-protection=bti
7+ // [PACRET ] compile-flags: -Z branch-protection=pac-ret
8+ // [LEAF ] compile-flags: -Z branch-protection=pac-ret,leaf
9+ // [BKEY ] compile-flags: -Z branch-protection=pac-ret,b-key
1010// compile-flags: --target aarch64-unknown-linux-gnu
1111
1212#![ crate_type = "lib" ]
@@ -20,22 +20,27 @@ trait Sized { }
2020pub fn test ( ) {
2121}
2222
23- // bti: !"branch-target-enforcement", i32 1
24- // bti: !"sign-return-address", i32 0
25- // bti: !"sign-return-address-all", i32 0
26- // bti: !"sign-return-address-with-bkey", i32 0
27-
28- // pac-ret: !"branch-target-enforcement", i32 0
29- // pac-ret: !"sign-return-address", i32 1
30- // pac-ret: !"sign-return-address-all", i32 0
31- // pac-ret: !"sign-return-address-with-bkey", i32 0
32-
33- // leaf: !"branch-target-enforcement", i32 0
34- // leaf: !"sign-return-address", i32 1
35- // leaf: !"sign-return-address-all", i32 1
36- // leaf: !"sign-return-address-with-bkey", i32 0
37-
38- // b-key: !"branch-target-enforcement", i32 0
39- // b-key: !"sign-return-address", i32 1
40- // b-key: !"sign-return-address-all", i32 0
41- // b-key: !"sign-return-address-with-bkey", i32 1
23+ // BTI: !"branch-target-enforcement", i32 1
24+ // BTI: !"sign-return-address", i32 0
25+ // BTI: !"sign-return-address-all", i32 0
26+ // BTI: !"sign-return-address-with-bkey", i32 0
27+
28+ // PACRET: !"branch-target-enforcement", i32 0
29+ // PACRET: !"sign-return-address", i32 1
30+ // PACRET: !"sign-return-address-all", i32 0
31+ // PACRET: !"sign-return-address-with-bkey", i32 0
32+
33+ // LEAF: !"branch-target-enforcement", i32 0
34+ // LEAF: !"sign-return-address", i32 1
35+ // LEAF: !"sign-return-address-all", i32 1
36+ // LEAF: !"sign-return-address-with-bkey", i32 0
37+
38+ // BKEY: !"branch-target-enforcement", i32 0
39+ // BKEY: !"sign-return-address", i32 1
40+ // BKEY: !"sign-return-address-all", i32 0
41+ // BKEY: !"sign-return-address-with-bkey", i32 1
42+
43+ // NONE-NOT: branch-target-enforcement
44+ // NONE-NOT: sign-return-address
45+ // NONE-NOT: sign-return-address-all
46+ // NONE-NOT: sign-return-address-with-bkey
0 commit comments