testsuite: Introduce be/le selectors
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 23 May 2018 17:31:05 +0000 (19:31 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 23 May 2018 17:31:05 +0000 (19:31 +0200)
This patch creates "be" and "le" selectors, which can be used by all
architectures, similar to ilp32 and lp64.

* doc/sourcebuild.texi (Endianness): New subsubsection.

gcc/testsuite/
* lib/target-supports.exp (check_effective_target_be): New.
(check_effective_target_le): New.

From-SVN: r260623

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index 38b26b1ad01d497244ebf1775822e9a21b9cae55..555a0f7ac006127484aa04327fe77eae9f0639c7 100644 (file)
@@ -1,3 +1,7 @@
+2017-05-23  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * doc/sourcebuild.texi (Endianness): New subsubsection.
+
 2018-05-23  Luis Machado  <luis.machado@linaro.org>
 
        * config/aarch64/aarch64-protos.h (cpu_prefetch_tune)
index dfb057805a6e58d4756b719afc10b0740c2f0a52..596007d630d9ca15f10c8cc25ff11364df32f796 100644 (file)
@@ -1313,6 +1313,16 @@ By convention, keywords ending in @code{_nocache} can also include options
 specified for the particular test in an earlier @code{dg-options} or
 @code{dg-add-options} directive.
 
+@subsubsection Endianness
+
+@table @code
+@item be
+Target uses big-endian memory order for multi-byte and multi-word data.
+
+@item le
+Target uses little-endian memory order for multi-byte and multi-word data.
+@end table
+
 @subsubsection Data type sizes
 
 @table @code
index db9ae1d793180764cb3daecdd94164860e0a14de..e9b35d5f4d3e61796a0914e8fe2b25e8b2555461 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-23  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * lib/target-supports.exp (check_effective_target_be): New.
+       (check_effective_target_le): New.
+
 2018-05-23  Marek Polacek  <polacek@redhat.com>
 
        * g++.dg/cpp2a/range-for1.C: New test.
index aa1296e6e61aa9396ef91bc6b0005d95ad4ba366..0a53d7b1aadd350e8167614e1d73b678f6ec93e8 100644 (file)
@@ -2523,6 +2523,22 @@ proc check_effective_target_next_runtime { } {
     }]
 }
 
+# Return 1 if we're generating code for big-endian memory order.
+
+proc check_effective_target_be { } {
+    return [check_no_compiler_messages be object {
+       int dummy[__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1 : -1];
+    }]
+}
+
+# Return 1 if we're generating code for little-endian memory order.
+
+proc check_effective_target_le { } {
+    return [check_no_compiler_messages le object {
+       int dummy[__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : -1];
+    }]
+}
+
 # Return 1 if we're generating 32-bit code using default options, 0
 # otherwise.