[PATCH][GCC][AARCH64] Add effective-target check to b key execution tests
authorSam Tebbs <sam.tebbs@arm.com>
Fri, 9 Aug 2019 14:11:54 +0000 (14:11 +0000)
committerSam Tebbs <samtebbs@gcc.gnu.org>
Fri, 9 Aug 2019 14:11:54 +0000 (14:11 +0000)
gcc/testsuite
2019-08-09  Sam Tebbs<sam.tebbs@arm.com>

* lib/target-supports.exp
(check_effective_target_arm_v8_4a_bkey_directive): New proc.
* g++.target/aarch64/return_address_sign_b_exception.C,
return_address_sign_ab_exception.C: Add dg-require-effective-target
checks.

From-SVN: r274236

gcc/testsuite/ChangeLog
gcc/testsuite/g++.target/aarch64/return_address_sign_ab_exception.C
gcc/testsuite/g++.target/aarch64/return_address_sign_b_exception.C
gcc/testsuite/lib/target-supports.exp

index 7ab92df5a56e25fb534a973f7e3ae4dec0dd0e57..51d0a87730bb518b2a10a77aafe175c651d54d0f 100644 (file)
@@ -1,3 +1,11 @@
+2019-08-09  Sam Tebbs <sam.tebbs@arm.com>
+
+       * lib/target-supports.exp
+       (check_effective_target_arm_v8_4a_bkey_directive): New proc.
+       * g++.target/aarch64/return_address_sign_b_exception.C,
+       return_address_sign_ab_exception.C: Add dg-require-effective-target
+       checks.
+
 2019-08-09  Richard Sandiford  <richard.sandiford@arm.com>
 
        PR middle-end/90313
index 520cd180beeba317a12d2404ce6e252eaeb6aa90..ead11de7b15dd82571345c9cc079e0be3c567b48 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "--save-temps" } */
+/* { dg-require-effective-target arm_v8_3a_bkey_directive } */
 
 __attribute__((target("branch-protection=pac-ret+leaf")))
 int foo_a () {
index eab2869e004b245944d2222b696e34dc4db90e6e..2f8273135503dbf49b9aa12ffad505ec2fe52b46 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-mbranch-protection=pac-ret+leaf+b-key --save-temps" } */
+/* { dg-require-effective-target arm_v8_3a_bkey_directive } */
 
 int foo () {
   throw 22;
index 815e83770b19a8d26d0286a00441e245743bbf46..3c50b8925025504a36c96b52a470a72bc0264edf 100644 (file)
@@ -9463,6 +9463,16 @@ proc check_effective_target_arm_v8_3a_complex_neon_hw { } {
     } [add_options_for_arm_v8_3a_complex_neon ""]]
 }
 
+# Return 1 if the assembler supports assembling the Armv8.3 pointer authentication B key directive
+proc check_effective_target_arm_v8_3a_bkey_directive { } {
+       return [check_no_compiler_messages cet object {
+               int main(void) {
+                       asm (".cfi_b_key_frame");
+                       return 0;
+               }
+       }]
+}
+
 # Returns 1 if the target is using glibc, 0 otherwise.
 
 proc check_effective_target_glibc { } {