public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Introduce be/le selectors
@ 2018-05-21 21:59 Segher Boessenkool
  2018-05-21 22:12 ` Rainer Orth
  2018-05-22 21:36 ` Jeff Law
  0 siblings, 2 replies; 11+ messages in thread
From: Segher Boessenkool @ 2018-05-21 21:59 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

This patch creates "be" and "le" selectors, which can be used by all
architectures, similar to ilp32 and lp64.

Is this okay for trunk?


Segher


2017-05-21  Segher Boessenkool  <segher@kernel.crashing.org>

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

---
 gcc/testsuite/lib/target-supports.exp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index cfc22a2..3b9460d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2641,6 +2641,22 @@ proc check_effective_target_long_neq_int { } {
     }]
 }
 
+# Return 1 if we're generating big-endian code.
+
+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 little-endian code.
+
+proc check_effective_target_le { } {
+    return [check_no_compiler_messages le object {
+	int dummy[__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports long double larger than double,
 # 0 otherwise.
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-27 18:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-21 21:59 [PATCH] testsuite: Introduce be/le selectors Segher Boessenkool
2018-05-21 22:12 ` Rainer Orth
2018-05-21 23:02   ` Segher Boessenkool
2018-05-22 21:36 ` Jeff Law
2018-05-23  9:33   ` Richard Earnshaw (lists)
2018-05-24 17:31     ` Segher Boessenkool
2018-05-25  9:37       ` Richard Earnshaw (lists)
2018-05-25 17:28         ` Segher Boessenkool
2018-05-23 17:53   ` Segher Boessenkool
2018-06-27 16:01     ` [PATCH] Backport " Kelvin Nilsen
2018-06-27 18:39       ` 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).