]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite/52641 - Fix gcc.dg/signbit-6.c for int != 32-bit targets.
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 2 Oct 2024 14:23:32 +0000 (16:23 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Wed, 2 Oct 2024 14:50:36 +0000 (16:50 +0200)
PR testsuite/52641
gcc/testsuite/
* gcc.dg/signbit-6.c (main): Initialize a[0] and b[0]
with INT32_MIN (instead of with INT_MIN).

gcc/testsuite/gcc.dg/signbit-6.c

index da186624cfa057dfc3780c8af4f6b1335ba07e7e..3a522893222d067eb68e242e48789b2f919fbebb 100644 (file)
@@ -38,8 +38,10 @@ int main ()
   TYPE a[N];
   TYPE b[N];
 
-  a[0] = INT_MIN;
-  b[0] = INT_MIN;
+  /* This will invoke UB due to -INT32_MIN.  The test is supposed to pass
+     because GCC is supposed to handle this UB case in a predictable way.  */
+  a[0] = INT32_MIN;
+  b[0] = INT32_MIN;
 
   for (int i = 1; i < N; ++i)
     {