diff options
author | Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> | 2017-04-11 05:09:41 +0000 |
---|---|---|
committer | Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org> | 2017-04-11 05:09:41 +0000 |
commit | abde687ac31890d073a6e769b19ef3ad5d9433a2 (patch) | |
tree | 83d909eb9d35576473abdde5ed503a04cac832ad | |
parent | b75179f367576ba1e10c7d38fc9089f2d4f7faed (diff) | |
download | gcc-abde687ac31890d073a6e769b19ef3ad5d9433a2.zip gcc-abde687ac31890d073a6e769b19ef3ad5d9433a2.tar.gz gcc-abde687ac31890d073a6e769b19ef3ad5d9433a2.tar.bz2 |
Fix bogus builtin-sprintf-warn-{3,10}.c failures for avr.
This patch fixes a whole bunch of failures reported for
gcc.dg/tree-ssa/builtin-sprintf-warn-{3,10}.c for the avr target.
builtin-sprintf-warn-10.c fails because the bounds in the warning
messages expect 4 digit wide exponents i.e. __DBL_MAX_EXP__ > 999.
For the avr, floats and doubles are both 32 bits wide, __DBL_MAX_EXP__
== 128, and the max number of exponent digits can only be 3 .
The computed size thus ends up one short of the value the test
expects. The patch makes the test run only for targets with double64plus.
builtin-sprintf-warn-3.c fails because the test appears to assume all
non lp64 targets to be ilp32. For the avr, pointer size and int size
are equal, but both are 16 bits, not 32. The patch fixes this by
explicitly adding avr to the dejagnu selector.
gcc/testsuite
2017-04-06 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Require double64plus.
* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c (void test_too_large):
Add avr-*-* to non-lp64 selector.
From-SVN: r246831
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c | 8 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8da9f09..a2d0865 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-04-11 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> + + * gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Require double64plus. + * gcc.dg/tree-ssa/builtin-sprintf-warn-3.c (void test_too_large): + Add avr-*-* to non-lp64 selector. + 2017-04-10 Martin Sebor <msebor@redhat.com> * gcc.dg/pr40340-3.c: Adjust directive pattern. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c index 1213e89..30599ad 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c @@ -2,6 +2,7 @@ Test to verify the correctness of ranges of output computed for floating point directives. { dg-do compile } + { dg-require-effective-target double64plus } { dg-options "-O2 -Wformat -Wformat-overflow -ftrack-macro-expansion=0" } */ typedef __builtin_va_list va_list; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c index 72ec3af..9db7ad7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c @@ -358,19 +358,19 @@ void test_too_large (char *d, int x, __builtin_va_list va) __builtin_snprintf (d, imax, "%c", x); __builtin_snprintf (d, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { ilp32 } } .-1 } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ __builtin_vsnprintf (d, imax, "%c", va); __builtin_vsnprintf (d, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { ilp32 } } .-1 } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ __builtin___snprintf_chk (d, imax, 0, imax, "%c", x); __builtin___snprintf_chk (d, imax_p1, 0, imax_p1, "%c", x); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { ilp32 } } .-1 } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ __builtin___vsnprintf_chk (d, imax, 0, imax, "%c", va); __builtin___vsnprintf_chk (d, imax_p1, 0, imax_p1, "%c", va); /* { dg-warning "specified bound \[0-9\]+ exceeds .INT_MAX." "INT_MAX + 1" { target lp64 } } */ - /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { ilp32 } } .-1 } */ + /* { dg-warning "specified bound \[0-9\]+ exceeds maximum object size" "INT_MAX + 1" { target { { avr-*-* } || ilp32 } } .-1 } */ const size_t ptrmax = __PTRDIFF_MAX__; const size_t ptrmax_m1 = ptrmax - 1; |