PR target/55146
[official-gcc.git] / gcc / testsuite / gcc.dg / ftrapv-3.c
blobe23059a078ca13737c5c5462b6817a11d959e673
1 /* { dg-do run } */
2 /* { dg-options "-ftrapv" } */
4 extern void abort (void);
5 unsigned long
6 foo (long i, long j)
8 /* We may not fold this to (unsigned long)(i * j). */
9 return -(unsigned long)(i * -j);
11 int main()
13 if (foo (-__LONG_MAX__ - 1, -1) != -(unsigned long)(-__LONG_MAX__ - 1))
14 abort ();
15 return 0;