]>
Commit | Line | Data |
---|---|---|
63626547 MG |
1 | /* { dg-do run } */ |
2 | /* { dg-options "-O -fwrapv" } */ | |
3 | ||
4 | #define DEF(num, T1, T2) T2 f##num(T1 x) { \ | |
5 | T1 y = -x; \ | |
6 | T2 z = (T2)y; \ | |
7 | return -z; \ | |
8 | } | |
9 | DEF(0, int, long long) | |
10 | ||
11 | int main(){ | |
12 | volatile int a = -1 - __INT_MAX__; | |
13 | volatile long long b = f0 (a); | |
14 | volatile long long c = a; | |
15 | volatile long long d = -c; | |
16 | if (b != d) | |
17 | __builtin_abort(); | |
18 | } |