diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-25 22:37:19 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-25 22:37:19 -0700 |
commit | 1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch) | |
tree | c607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c | |
parent | 283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff) | |
download | toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2 toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip |
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c new file mode 100644 index 000000000..b44d7f58e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c @@ -0,0 +1,65 @@ +#include <stdarg.h> + +#include "compat-common.h" + +#include "mixed-struct-defs.h" +#include "mixed-struct-init.h" + +#define T(TYPE) \ +extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \ +extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \ +extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \ +extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \ + \ +extern void check##TYPE (TYPE x, int i); \ + \ +void \ +checkg##TYPE (void) \ +{ \ + check##TYPE (g01##TYPE, 1); \ + check##TYPE (g02##TYPE, 2); \ + check##TYPE (g03##TYPE, 3); \ + check##TYPE (g04##TYPE, 4); \ + check##TYPE (g05##TYPE, 5); \ + check##TYPE (g06##TYPE, 6); \ + check##TYPE (g07##TYPE, 7); \ + check##TYPE (g08##TYPE, 8); \ + check##TYPE (g09##TYPE, 9); \ + check##TYPE (g10##TYPE, 10); \ + check##TYPE (g11##TYPE, 11); \ + check##TYPE (g12##TYPE, 12); \ + check##TYPE (g13##TYPE, 13); \ + check##TYPE (g14##TYPE, 14); \ + check##TYPE (g15##TYPE, 15); \ + check##TYPE (g16##TYPE, 16); \ +} \ + \ +TYPE \ +test0##TYPE (void) \ +{ \ + return g01##TYPE; \ +} \ + \ +TYPE \ +test1##TYPE (TYPE x01) \ +{ \ + return x01; \ +} \ + \ +TYPE \ +testva##TYPE (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; \ +} + +T(Sfi) +T(Sfii) +T(Sfifi) +T(Sfiifii) |