]> gcc.gnu.org Git - gcc.git/commitdiff
Fix bogus builtin-sprintf-warn-{3,10}.c failures for avr.
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Tue, 11 Apr 2017 05:09:41 +0000 (05:09 +0000)
committerSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Tue, 11 Apr 2017 05:09:41 +0000 (05:09 +0000)
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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-10.c
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c

index 8da9f0948012069fa68b99081cce0104ad074a55..a2d0865502843c7ab022b2266900d52f897bd6ba 100644 (file)
@@ -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.
index 1213e89f7bb0b2c19d715c81a5cef0f07830364e..30599ad04dca42df49adc4cb55aa13363e15ab5d 100644 (file)
@@ -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;
index 72ec3afaa41fcaa4bd1bf621a1ce233167a2835e..9db7ad74f370bd86397c135d169d85ed6ba219db 100644 (file)
@@ -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;
This page took 0.087971 seconds and 5 git commands to generate.