| 1 |
/* The bit-field below would have a problem if __INT_MAX__ is too |
| 2 |
small. */ |
| 3 |
void abort (void); |
| 4 |
void exit (int); |
| 5 |
|
| 6 |
#if __INT_MAX__ < 2147483647 |
| 7 |
int |
| 8 |
main (void) |
| 9 |
{ |
| 10 |
exit (0); |
| 11 |
} |
| 12 |
#else |
| 13 |
/* Failed on powerpc due to bad extzvsi pattern. */ |
| 14 |
|
| 15 |
struct ieee |
| 16 |
{ |
| 17 |
unsigned int negative:1; |
| 18 |
unsigned int exponent:11; |
| 19 |
unsigned int mantissa0:20; |
| 20 |
unsigned int mantissa1:32; |
| 21 |
} x; |
| 22 |
|
| 23 |
unsigned int |
| 24 |
foo (void) |
| 25 |
{ |
| 26 |
unsigned int exponent; |
| 27 |
|
| 28 |
exponent = x.exponent; |
| 29 |
if (exponent == 0) |
| 30 |
return 1; |
| 31 |
else if (exponent > 1) |
| 32 |
return 2; |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
int |
| 37 |
main (void) |
| 38 |
{ |
| 39 |
x.exponent = 1; |
| 40 |
if (foo () != 0) |
| 41 |
abort (); |
| 42 |
return 0; |
| 43 |
} |
| 44 |
#endif |