summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c')
-rw-r--r--gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c b/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
new file mode 100644
index 000000000..245c4c571
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
@@ -0,0 +1,73 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1+INITVAL); \
+ check##NAME (g02##NAME, 2+INITVAL); \
+ check##NAME (g03##NAME, 3+INITVAL); \
+ check##NAME (g04##NAME, 4+INITVAL); \
+ check##NAME (g05##NAME, 5+INITVAL); \
+ check##NAME (g06##NAME, 6+INITVAL); \
+ check##NAME (g07##NAME, 7+INITVAL); \
+ check##NAME (g08##NAME, 8+INITVAL); \
+ check##NAME (g09##NAME, 9+INITVAL); \
+ check##NAME (g10##NAME, 10+INITVAL); \
+ check##NAME (g11##NAME, 11+INITVAL); \
+ check##NAME (g12##NAME, 12+INITVAL); \
+ check##NAME (g13##NAME, 13+INITVAL); \
+ check##NAME (g14##NAME, 14+INITVAL); \
+ check##NAME (g15##NAME, 15+INITVAL); \
+ check##NAME (g16##NAME, 16+INITVAL); \
+} \
+ \
+TYPE \
+test0##NAME (void) \
+{ \
+ return g01##NAME; \
+} \
+ \
+TYPE \
+test1##NAME (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci, _Complex int, CINT (2, 3))
+T(cl, _Complex long, CINT (3, 4))
+T(cll, _Complex long long, CINT (4, 5))
+#endif
+T(cd, _Complex double, CDBL (2.0, 3.0))
+T(cld, _Complex long double, CDBL (3.0, 4.0))
+#endif