* [AArch64] Use effective-target keyword to test for endianness
@ 2012-08-17 15:03 Sofiane Naci
0 siblings, 0 replies; only message in thread
From: Sofiane Naci @ 2012-08-17 15:03 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 675 bytes --]
Hi,
I've just committed the attached patch on the AArch64 branch to use
effective-target keyword to test for endianness.
Thanks
Sofiane
-----
r190482 | sofiane | 2012-08-17 16:02:20 +0100 (Fri, 17 Aug 2012) | 9 lines
[AArch64] Use effective-target to check for big endian
gcc/testsuite
* lib/target-supports.exp
(check_effective_target_aarch64_big_endian): New.
* gcc.target/aarch64/aapcs64/func-ret-3.c: Add
dg-require-effective-target.
* gcc.target/aarch64/aapcs64/func-ret-4.c: Likewise.
* gcc.target/aarch64/aapcs64/func-ret-3.x: Delete.
* gcc.target/aarch64/aapcs64/func-ret-4.x: Delete.
[-- Attachment #2: aarch64-be-effective-target.patch --]
[-- Type: application/octet-stream, Size: 2463 bytes --]
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.x
===================================================================
--- gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.x (revision 190481)
+++ gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.x (working copy)
@@ -1,5 +0,0 @@
-if { [istarget aarch64_be-*-*] } then {
- return 1
-}
-
-return 0
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c
===================================================================
--- gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c (revision 190481)
+++ gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c (working copy)
@@ -5,6 +5,7 @@
/* { dg-do run { target aarch64-*-* } } */
/* { dg-additional-sources "abitest.S" } */
+/* { dg-require-effective-target aarch64_big_endian } */
#ifndef IN_FRAMEWORK
#define TESTFILE "func-ret-3.c"
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.x
===================================================================
--- gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.x (revision 190481)
+++ gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.x (working copy)
@@ -1,5 +0,0 @@
-if { [istarget aarch64_be-*-*] } then {
- return 1
-}
-
-return 0
Index: gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c
===================================================================
--- gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c (revision 190481)
+++ gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c (working copy)
@@ -6,6 +6,7 @@
/* { dg-do run { target aarch64*-*-* } } */
/* { dg-additional-sources "abitest.S" } */
+/* { dg-require-effective-target aarch64_big_endian } */
#ifndef IN_FRAMEWORK
#define TESTFILE "func-ret-4.c"
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 190481)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -2004,6 +2004,15 @@
return $et_vect_floatuint_cvt_saved
}
+# Return 1 if this is a AArch64 target supporting big endian
+proc check_effective_target_aarch64_big_endian { } {
+ return [check_no_compiler_messages aarch64_big_endian assembly {
+ #if !defined(__aarch64__) || !defined(__AARCH64EB__)
+ #error FOO
+ #endif
+ }]
+}
+
# Return 1 is this is an arm target using 32-bit instructions
proc check_effective_target_arm32 { } {
return [check_no_compiler_messages arm32 assembly {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-08-17 15:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 15:03 [AArch64] Use effective-target keyword to test for endianness Sofiane Naci
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).