summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/compat/union-check.h
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-16 18:38:32 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-16 18:38:32 +0000
commit1d812f79b291453f81ca64ac7ee7c706a316e241 (patch)
tree126bb86371e3f22d0dcd50451896d7cad5f732f5 /gcc/testsuite/gcc.dg/compat/union-check.h
parent4fa32263ed08a1ed077fbc99a1aa260ff250e036 (diff)
downloadgcc-1d812f79b291453f81ca64ac7ee7c706a316e241.tar.gz
* gcc.dg/compat/union-by-value-1_main.c,
union-by-value-1_x.c, union-by-value-1_y.c, union-check.h, union-defs.h, union-init.h, union-return-1_main.c, union-return-1_x.c, union-return-1_y.c: New files. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/compat/union-check.h')
-rw-r--r--gcc/testsuite/gcc.dg/compat/union-check.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/union-check.h b/gcc/testsuite/gcc.dg/compat/union-check.h
new file mode 100644
index 00000000000..b5157814d58
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/union-check.h
@@ -0,0 +1,34 @@
+/* Function definitions that are used by multiple tests. */
+
+#define CHECK_CHAR(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.c != (char)i) DEBUG_CHECK }
+
+CHECK_CHAR(Ucs)
+CHECK_CHAR(Uci)
+CHECK_CHAR(Ucl)
+CHECK_CHAR(Ucll)
+
+
+#define CHECK_SHORT(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.s != (short)i) DEBUG_CHECK }
+
+CHECK_SHORT(Usi)
+CHECK_SHORT(Usl)
+CHECK_SHORT(Usll)
+
+
+#define CHECK_INT(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.i != i) DEBUG_CHECK }
+
+CHECK_INT(Uil)
+CHECK_INT(Uill)
+
+
+#define CHECK_LONG(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.l != (long)i) DEBUG_CHECK }
+
+CHECK_LONG(Ulll)