PR rtl-optimization/88018
[official-gcc.git] / gcc / testsuite / c-c++-common / torture / builtin-arith-overflow-9.c
blob80549069718ec96ec704ece018cfb61e1576e9d0
1 /* Test __builtin_{add,sub}_overflow on {,un}signed int. */
2 /* { dg-do run } */
3 /* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */
5 typedef signed int S;
6 typedef unsigned int U;
7 #define COND 1
8 #define SHIFT ((__SIZEOF_INT__ - 1) * __CHAR_BIT__)
9 #define S_MAX __INT_MAX__
10 #define S_MIN (-__INT_MAX__ - 1)
11 #if __SIZEOF_LONG__ > __SIZEOF_INT__
12 typedef long int W;
13 #elif __SIZEOF_LONG_LONG__ > __SIZEOF_INT__
14 typedef long long int W;
15 #elif __SIZEOF_INT128__ > __SIZEOF_INT__
16 typedef __int128 W;
17 #else
18 #undef COND
19 #define COND 0
20 #endif
21 #include "builtin-arith-overflow-7.c"