This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add check_effective_target_stdint_types


More and more testcases keep getting added that require <stdint.h>
and the types defined therein.  I thought it might be useful to define
a proc to check for this support instead of hacking each new testcase
to provide the required types without using <stdint.h>.

The enclosed change fixes a couple of PRs.  It has been tested on
hppa2.0w-hp-hpux11.11 and hppa-unknown-linux-gnu with no observed
regressions.

Ok for trunk?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2006-12-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR testsuite/30179
	PR testsuite/30180
	* gcc.dg/builtin-bswap-1.c: Require stdint_types.
	* gcc.dg/builtin-bswap-2.c: Likewise.
	* gcc.dg/builtin-bswap-3.c: Likewise.
	* gcc.dg/builtin-bswap-4.c: Likewise.
	* lib/target-supports.exp (check_effective_target_stdint_types): New.
	* gcc.c-torture/execute/mode-dependent-address.x: New file.

Index: gcc.dg/builtin-bswap-1.c
===================================================================
--- gcc.dg/builtin-bswap-1.c	(revision 119868)
+++ gcc.dg/builtin-bswap-1.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target stdint_types } */
 /* { dg-options "" } */
 /* { dg-final { scan-assembler-not "__builtin_" } } */
 
Index: gcc.dg/builtin-bswap-3.c
===================================================================
--- gcc.dg/builtin-bswap-3.c	(revision 119868)
+++ gcc.dg/builtin-bswap-3.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
 /* { dg-options "" } */
 #include <stdint.h>
 
Index: gcc.dg/builtin-bswap-2.c
===================================================================
--- gcc.dg/builtin-bswap-2.c	(revision 119868)
+++ gcc.dg/builtin-bswap-2.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
 /* { dg-options "" } */
 #include <stdint.h>
 
Index: gcc.dg/builtin-bswap-4.c
===================================================================
--- gcc.dg/builtin-bswap-4.c	(revision 119844)
+++ gcc.dg/builtin-bswap-4.c	(working copy)
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
 /* { dg-options "-Wall" } */
 
 #include <stdint.h>
Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 119844)
+++ lib/target-supports.exp	(working copy)
@@ -2046,3 +2045,14 @@
 		    const char *var = "String";
 		} {-O2}]
 }
+
+# Return 1 if target has the basic signed and unsigned types in
+# <stdint.h>, 0 otherwise.
+
+proc check_effective_target_stdint_types { } {
+    return [check_no_compiler_messages stdint_types assembly {
+	#include <stdint.h>
+	int8_t a; int16_t b; int32_t c; int64_t d;
+	uint8_t e; uint16_t f; uint32_t g; uint64_t h;
+    }]
+}
--- /dev/null	Thu Dec 14 16:46:15 2006
+++ gcc.c-torture/execute/mode-dependent-address.x	Thu Dec 14 16:38:12 2006
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { ! [check_effective_target_stdint_types] } {
+	return 1
+}
+
+return 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]