From c614f63ffa64d18ed073ee972bf30b0e0a2a0476 Mon Sep 17 00:00:00 2001 From: bwilson Date: Tue, 7 Oct 2008 16:19:38 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140939 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 9 ++++++ .../g++.dg/compat/struct-layout-1_generate.c | 3 +- .../gcc.dg/compat/struct-layout-1_generate.c | 35 +++++++++++++--------- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c76fb09b99..3e13806fd16 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2008-10-07 Bob Wilson + + * 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 * 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 8535022b7fc..589cc787fd8 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 097ef5053a8..d50322c9f87 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 . 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"); -- 2.11.4.GIT