]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/testsuite: fix excess warnings for mingw-w64
authorJonathan Yong <10walls@gmail.com>
Sat, 28 Jan 2023 16:49:27 +0000 (16:49 +0000)
committerJonathan Yong <10walls@gmail.com>
Sat, 11 Feb 2023 08:27:27 +0000 (08:27 +0000)
gcc/testsuite/ChangeLog:

* c-c++-common/Wsizeof-array-div1.c: fix excess warnings.
* gcc.dg/Warray-bounds-52.c: ditto
* gcc.dg/Wstringop-overflow-62.c: ditto
* gcc.dg/attr-vector_size.c: ditto
* gcc.dg/overflow-warn-9.c: ditto

Signed-off-by: Jonathan Yong <10walls@gmail.com>
gcc/testsuite/c-c++-common/Wsizeof-array-div1.c
gcc/testsuite/gcc.dg/Warray-bounds-52.c
gcc/testsuite/gcc.dg/Wstringop-overflow-62.c
gcc/testsuite/gcc.dg/attr-vector_size.c
gcc/testsuite/gcc.dg/overflow-warn-9.c

index 6e01d6c87d1cb510087de11fdd15d175600ac059..068ce0145ca6541edadfabe329b3b7144ed3affe 100644 (file)
@@ -13,12 +13,12 @@ fn (int ap[])
   int r = 0;
 
   r += sizeof (arr) / sizeof (*arr);
-  r += sizeof (arr) / sizeof (p); /* { dg-warning "expression does not compute" "" { target { lp64 } } } */
-  r += sizeof (arr) / sizeof p; /* { dg-warning "expression does not compute" "" { target { lp64 } } } */
+  r += sizeof (arr) / sizeof (p); /* { dg-warning "expression does not compute" "" { target { ! ilp32 } } } */
+  r += sizeof (arr) / sizeof p; /* { dg-warning "expression does not compute" "" { target { ! ilp32 } } } */
   r += sizeof (arr) / (sizeof p);
   r += sizeof (arr) / (sizeof (p));
   r += sizeof (arr2) / sizeof p;
-  r += sizeof (arr2) / sizeof (int); /* { dg-warning "expression does not compute" "" { target { lp64 } } } */
+  r += sizeof (arr2) / sizeof (int); /* { dg-warning "expression does not compute" "" { target { ! ilp32 } } } */
   r += sizeof (arr2) / sizeof (int *);
   r += sizeof (arr2) / sizeof (short *);
   r += sizeof (arr) / sizeof (int);
index c7217ad4f7b8eeb47dd8114b3939a8288c209f6b..69dc15ace2dab1204e2d543eadcfc7a8b77f8b5a 100644 (file)
@@ -60,7 +60,7 @@ void ptr_idx_cst (void)
   T ( 0, (int[]){ 1 });
   T (+1, (int[]){ 1 });         // { dg-warning "array subscript 1 is outside array bounds of 'int\\\[1]'" }
   T (INT_MIN, (int[]){ 1 });    // { dg-warning "array subscript -\[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { xfail ilp32 } }
-  T (INT_MAX, (int[]){ 1 });    // { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { target lp64 } }
+  T (INT_MAX, (int[]){ 1 });    // { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "not-ilp32" { target { ! ilp32 } } }
                                 // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" "ilp32" { target ilp32 } .-1 }
   T (SIZE_MAX, (int[]){ 1 });   // { dg-warning "array subscript -?\[0-9\]+ is outside array bounds of 'int\\\[1]'" }
 }
index ea19aa85905b79412c868ae7dd437344841fdf96..d589f077887e150f944ccbc04863f3c77a57db0a 100644 (file)
@@ -41,7 +41,7 @@ void test_min (void)
     memset (q, 0, DIFF_MAX - 2);
     memset (q, 0, DIFF_MAX);
     // { dg-warning "writing 2147483647 bytes into a region of size 2147483646" "ilp32" { target ilp32 } .-1 }
-    // { dg-warning "writing 9223372036854775807 bytes into a region of size 9223372036854775806" "lp64" { target lp64 } .-2 }
+    // { dg-warning "writing 9223372036854775807 bytes into a region of size 9223372036854775806" "not-ilp32" { target { ! ilp32 } } .-2 }
   }
 
   {
index 3f2ce88912111b4fa73aeee88d7245ddcb4e0000..9177e25250a27871dccb20a09a64250a7b9b395f 100644 (file)
@@ -22,7 +22,7 @@ DEFVEC (extern, 30);
 
 #if __SIZEOF_SIZE_T__ > 4
 
-VEC (POW2 (63)) char v63;     /* { dg-error  "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "LP64" { target lp64 } } */
+VEC (POW2 (63)) char v63;     /* { dg-error  "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "not-ILP32" { target { ! ilp32 } } } */
 
 #else
 
@@ -41,7 +41,7 @@ void test_local_scope (void)
 
 #if __SIZEOF_SIZE_T__ > 4
 
-  VEC (POW2 (63)) char v63;   /* { dg-error  "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "LP64" { target lp64 } } */
+  VEC (POW2 (63)) char v63;   /* { dg-error  "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "not-ILP32" { target { ! ilp32 } } } */
 
 #else
 
index 3c41d976688df6c6fe9464b374851bc503f424d9..57c0f17bc91d779d61dfa2f622b2ba33894737f6 100644 (file)
@@ -59,7 +59,7 @@ const struct Types t1 = {
   .ui = UINT_MAX + 1L,      /* { dg-warning "signed conversion from .long int. to .unsigned int. changes value from .4294967296. to .0." "lp64" { target lp64 } } */
   .ui = UINT_MAX + 1LU,     /* { dg-warning "conversion from .long unsigned int. to .unsigned int. changes value from .4294967296. to .0." "lp64" { target lp64 } } */
 
-  .sl = LONG_MAX + 1LU,     /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .9223372036854775808. to .-9223372036854775808." "lp64" { target lp64 } } */
+  .sl = LONG_MAX + 1LU,     /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .9223372036854775808. to .-9223372036854775808." "not-ilp32" { target { ! ilp32 } } } */
   /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .2147483648. to .-2147483648." "ilp32" { target ilp32 } .-1 } */
   .ul = ULONG_MAX + 1LU     /* there should be some warning here */
 };