| 1 |
/* { dg-require-effective-target int32plus } */ |
| 2 |
#include <limits.h> |
| 3 |
|
| 4 |
extern void exit (int); |
| 5 |
extern void abort (); |
| 6 |
|
| 7 |
void test01(unsigned int a, unsigned int b) |
| 8 |
{ |
| 9 |
if (a < 5) |
| 10 |
abort(); |
| 11 |
if (b < 5) |
| 12 |
abort(); |
| 13 |
if (a - b != 5) |
| 14 |
abort(); |
| 15 |
} |
| 16 |
|
| 17 |
void test02(unsigned int a, unsigned int b) |
| 18 |
{ |
| 19 |
if (a >= 12) |
| 20 |
if (b > 15) |
| 21 |
if (a - b < UINT_MAX - 15U) |
| 22 |
abort (); |
| 23 |
} |
| 24 |
|
| 25 |
int main(int argc, char *argv[]) |
| 26 |
{ |
| 27 |
unsigned x = 0x80000000; |
| 28 |
test01(x + 5, x); |
| 29 |
test02(14, 16); |
| 30 |
exit (0); |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
|