| 1 |
/* { dg-require-effective-target int32plus } */ |
| 2 |
#ifdef __UINT32_TYPE__ |
| 3 |
typedef __UINT32_TYPE__ uint32_t; |
| 4 |
#else |
| 5 |
typedef unsigned uint32_t; |
| 6 |
#endif |
| 7 |
|
| 8 |
#ifdef __UINT8_TYPE__ |
| 9 |
typedef __UINT8_TYPE__ uint8_t; |
| 10 |
#else |
| 11 |
typedef unsigned char uint8_t; |
| 12 |
#endif |
| 13 |
|
| 14 |
struct |
| 15 |
{ |
| 16 |
uint32_t a; |
| 17 |
uint8_t b; |
| 18 |
} s = { 0x123456, 0x78 }; |
| 19 |
|
| 20 |
int pr67781() |
| 21 |
{ |
| 22 |
uint32_t c = (s.a << 8) | s.b; |
| 23 |
return c; |
| 24 |
} |
| 25 |
|
| 26 |
int |
| 27 |
main () |
| 28 |
{ |
| 29 |
if (sizeof (uint32_t) * __CHAR_BIT__ != 32) |
| 30 |
return 0; |
| 31 |
|
| 32 |
if (pr67781 () != 0x12345678) |
| 33 |
__builtin_abort (); |
| 34 |
return 0; |
| 35 |
} |