From 9c4cb8615fc71a117c00844fd608ae6788acfd92 Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Fri, 9 Aug 2019 14:11:54 +0000 Subject: [PATCH] [PATCH][GCC][AARCH64] Add effective-target check to b key execution tests gcc/testsuite 2019-08-09 Sam Tebbs * 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 | 8 ++++++++ .../aarch64/return_address_sign_ab_exception.C | 1 + .../aarch64/return_address_sign_b_exception.C | 1 + gcc/testsuite/lib/target-supports.exp | 10 ++++++++++ 4 files changed, 20 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7ab92df5a56..51d0a87730b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2019-08-09 Sam Tebbs + + * 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 PR middle-end/90313 diff --git a/gcc/testsuite/g++.target/aarch64/return_address_sign_ab_exception.C b/gcc/testsuite/g++.target/aarch64/return_address_sign_ab_exception.C index 520cd180bee..ead11de7b15 100644 --- a/gcc/testsuite/g++.target/aarch64/return_address_sign_ab_exception.C +++ b/gcc/testsuite/g++.target/aarch64/return_address_sign_ab_exception.C @@ -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 () { diff --git a/gcc/testsuite/g++.target/aarch64/return_address_sign_b_exception.C b/gcc/testsuite/g++.target/aarch64/return_address_sign_b_exception.C index eab2869e004..2f827313550 100644 --- a/gcc/testsuite/g++.target/aarch64/return_address_sign_b_exception.C +++ b/gcc/testsuite/g++.target/aarch64/return_address_sign_b_exception.C @@ -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; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 815e83770b1..3c50b892502 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -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 { } { -- 2.30.2