diff options
author | Paul Brook <paul@codesourcery.com> | 2006-01-26 04:08:39 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2006-01-26 04:08:39 +0000 |
commit | efe5e271097ac8d761b396ab8f36628044c8381c (patch) | |
tree | 626d3274fb4c1b042b35b73718819d1d3e244bdb /gcc/testsuite/gcc.dg | |
parent | ee45f67911c04907fd0349670fa412ed1089412b (diff) | |
download | gcc-efe5e271097ac8d761b396ab8f36628044c8381c.zip gcc-efe5e271097ac8d761b396ab8f36628044c8381c.tar.gz gcc-efe5e271097ac8d761b396ab8f36628044c8381c.tar.bz2 |
struct-layout-1.exp: Pass -e to generator program on short-enum targets.
2006-01-26 Paul Brook <paul@codesourcery.com>
* gcc.dg/compat/struct-layout-1.exp: Pass -e to generator program
on short-enum targets.
* gcc.dg/compat/struct-layout-1_generate.c (short_enums): New
variable.
(generate_fields): Use short_enums.
(main): Set short_enums. Document -e.
* g++.dg/compat/struct-layout-1.exp: Pass -e to generator program
on short-enum targets.
* g++.dg/compat/struct-layout-1_generate.c (short_enums): New
variable.
(generate_fields): Use short_enums.
(main): Set short_enums. Document -e.
* lib/target-supports.exp (check_effective_target_short_enums): New.
From-SVN: r110247
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/struct-layout-1.exp | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c | 16 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp index 46fdae6..940b637 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp @@ -99,6 +99,9 @@ if { $status == 0 } then { if [info exists env(RUN_ALL_COMPAT_TESTS) ] then { set generator_args "$generator_args -n 15000" } + if [check_effective_target_short_enums] then { + set generator_args "-e $generator_args" + } set status [remote_exec host "$generator $generator_args"] set status [lindex $status 0] if { $status == 0 } then { 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 6af27d0..59b777f 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c @@ -718,7 +718,7 @@ struct entry #define HASH_SIZE 32749 static struct entry *hash_table[HASH_SIZE]; -static int idx, limidx, output_one; +static int idx, limidx, output_one, short_enums; static const char *destdir; static const char *srcdir; FILE *outfile; @@ -1759,10 +1759,14 @@ generate_fields (enum FEATURE features, struct entry *e, struct entry *parent, abort (); if (!mi) mi = 1; - if (mi <= 32) + if (mi > 32) + ma = 64; + else if (mi > 16 || !short_enums) ma = 32; + else if (mi > 8) + ma = 16; else - ma = 64; + ma = 8; break; default: abort (); @@ -1935,6 +1939,10 @@ main (int argc, char **argv) output_one = 1; limidx = atoi (optarg); break; + case 'e': + short_enums = 1; + i--; + break; default: fprintf (stderr, "unrecognized option %s\n", argv[i]); goto usage; @@ -1957,7 +1965,7 @@ main (int argc, char **argv) { usage: fprintf (stderr, "Usage:\n\ -%s [-s srcdir -d destdir] [-n count] [-i idx]\n\ +%s [-e] [-s srcdir -d destdir] [-n count] [-i idx]\n\ Either -s srcdir -d destdir or -i idx must be used\n", argv[0]); return 1; } |