aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-10-07 16:19:38 +0000
committerBob Wilson <bwilson@gcc.gnu.org>2008-10-07 16:19:38 +0000
commita76e62c8959ddc39034518435975aad4000f9079 (patch)
tree753a9eee2a1c024a1b925a7b3e7e581fde46a46e /gcc
parent23cb97b79d10602832ec9617bac5e5e387e883ea (diff)
downloadgcc-a76e62c8959ddc39034518435975aad4000f9079.zip
gcc-a76e62c8959ddc39034518435975aad4000f9079.tar.gz
gcc-a76e62c8959ddc39034518435975aad4000f9079.tar.bz2
struct-layout-1_generate.c (dg_options): New.
* gcc.dg/compat/struct-layout-1_generate.c (dg_options): New. Moved dg-options lines to this array, and added options for xtensa*-*-*. (NDG_OPTIONS): Define. (switchfiles): Print dg-options lines from new dg_options array. * g++.dg/compat/struct-layout-1_generate.c (dg_options): Add options for xtensa*-*-* targets. From-SVN: r140939
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c3
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c35
3 files changed, 32 insertions, 15 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1c76fb0..3e13806 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-07 Bob Wilson <bob.wilson@acm.org>
+
+ * gcc.dg/compat/struct-layout-1_generate.c (dg_options): New. Moved
+ dg-options lines to this array, and added options for xtensa*-*-*.
+ (NDG_OPTIONS): Define.
+ (switchfiles): Print dg-options lines from new dg_options array.
+ * g++.dg/compat/struct-layout-1_generate.c (dg_options): Add options
+ for xtensa*-*-* targets.
+
2008-10-07 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/addr4.adb: New test.
diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
index 8535022..589cc78 100644
--- a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
@@ -46,7 +46,8 @@ const char *dg_options[] = {
"/* { dg-options \"%s-I%s\" } */\n",
"/* { dg-options \"%s-I%s -mno-mmx\" { target i?86-*-* x86_64-*-* } } */\n",
"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* } } */\n",
-"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n"
+"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n",
+"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target xtensa*-*-* } } */\n"
#define NDG_OPTIONS (sizeof (dg_options) / sizeof (dg_options[0]))
};
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
index 097ef50..d50322c 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
@@ -1,5 +1,5 @@
/* Structure layout test generator.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>.
This file is part of GCC.
@@ -42,6 +42,14 @@ along with GCC; see the file COPYING3. If not see
#define COMPAT_PRLL "ll"
#endif
+const char *dg_options[] = {
+"/* { dg-options \"%s-I%s\" } */\n",
+"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n",
+"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n",
+"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target xtensa*-*-* } } */\n"
+#define NDG_OPTIONS (sizeof (dg_options) / sizeof (dg_options[0]))
+};
+
typedef unsigned int hashval_t;
enum TYPE
@@ -747,6 +755,8 @@ switchfiles (int fields)
{
static int filecnt;
static char *destbuf, *destptr;
+ int i;
+
++filecnt;
if (outfile)
fclose (outfile);
@@ -774,11 +784,10 @@ switchfiles (int fields)
fputs ("failed to create test files\n", stderr);
exit (1);
}
+ fprintf (outfile, "/* { dg-require-effective-target int32plus } */\n");
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "", srcdir_safe);
fprintf (outfile, "\
-/* { dg-require-effective-target int32plus } */\n\
-/* { dg-options \"-I%s\" } */\n\
-/* { dg-options \"-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
-/* { dg-options \"-I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
#include \"struct-layout-1.h\"\n\
\n\
#define TX(n, type, attrs, fields, ops) extern void test##n (void);\n\
@@ -796,33 +805,31 @@ int main (void)\n\
abort ();\n\
}\n\
exit (0);\n\
-}\n", srcdir_safe, srcdir_safe, srcdir_safe, filecnt, filecnt);
+}\n", filecnt, filecnt);
fclose (outfile);
sprintf (destptr, "t%03d_x.c", filecnt);
outfile = fopen (destbuf, "w");
if (outfile == NULL)
goto fail;
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "-w ", srcdir_safe);
fprintf (outfile, "\
-/* { dg-options \"-w -I%s\" } */\n\
-/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
-/* { dg-options \"-w -I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
#include \"struct-layout-1_x1.h\"\n\
#include \"t%03d_test.h\"\n\
#include \"struct-layout-1_x2.h\"\n\
-#include \"t%03d_test.h\"\n", srcdir_safe, srcdir_safe, srcdir_safe, filecnt, filecnt);
+#include \"t%03d_test.h\"\n", filecnt, filecnt);
fclose (outfile);
sprintf (destptr, "t%03d_y.c", filecnt);
outfile = fopen (destbuf, "w");
if (outfile == NULL)
goto fail;
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "-w ", srcdir_safe);
fprintf (outfile, "\
-/* { dg-options \"-w -I%s\" } */\n\
-/* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\
-/* { dg-options \"-w -I%s -mno-base-addresses\" { target mmix-*-* } } */\n\
#include \"struct-layout-1_y1.h\"\n\
#include \"t%03d_test.h\"\n\
#include \"struct-layout-1_y2.h\"\n\
-#include \"t%03d_test.h\"\n", srcdir_safe, srcdir_safe, srcdir_safe, filecnt, filecnt);
+#include \"t%03d_test.h\"\n", filecnt, filecnt);
fclose (outfile);
sprintf (destptr, "t%03d_test.h", filecnt);
outfile = fopen (destbuf, "w");