* [PATCH][GCC][AARCH64] Add effective-target check to b key execution tests
@ 2019-08-07 16:08 Sam Tebbs
2019-08-08 15:55 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Sam Tebbs @ 2019-08-07 16:08 UTC (permalink / raw)
To: gcc-patches; +Cc: Richard Earnshaw, Marcus Shawcroft, James Greenhalgh, nd
[-- Attachment #1: Type: text/plain, Size: 696 bytes --]
Hi all,
This patch adds an effective target check to the pointer authentication B key execution tests. These were failing with an assembler error when run with a non-recent version of binutils, and this change will instead make them unsupported in such cases.
Tested with a recent version of binutils where it passes, and with a non-recent version where it is unsupported.
OK for trunk?
Sam
gcc/testsuite
2019-08-02 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.
[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 1812 bytes --]
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 520cd18..ead11de 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 eab2869..2f82731 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 815e837..3c50b89 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 { } {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][GCC][AARCH64] Add effective-target check to b key execution tests
2019-08-07 16:08 [PATCH][GCC][AARCH64] Add effective-target check to b key execution tests Sam Tebbs
@ 2019-08-08 15:55 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2019-08-08 15:55 UTC (permalink / raw)
To: Sam Tebbs, gcc-patches
Cc: Richard Earnshaw, Marcus Shawcroft, James Greenhalgh, nd
On 8/7/19 9:57 AM, Sam Tebbs wrote:
> Hi all,
>
> This patch adds an effective target check to the pointer authentication B key execution tests. These were failing with an assembler error when run with a non-recent version of binutils, and this change will instead make them unsupported in such cases.
>
> Tested with a recent version of binutils where it passes, and with a non-recent version where it is unsupported.
>
> OK for trunk?
>
> Sam
>
> gcc/testsuite
> 2019-08-02 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.
>
OK
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-08 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 16:08 [PATCH][GCC][AARCH64] Add effective-target check to b key execution tests Sam Tebbs
2019-08-08 15:55 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).