| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-fsso-struct=native" } */ |
| 3 |
/* { dg-require-effective-target int32plus } */ |
| 4 |
|
| 5 |
struct S1 |
| 6 |
{ |
| 7 |
int i; |
| 8 |
}; |
| 9 |
|
| 10 |
|
| 11 |
struct S1 my_s1 = { 0x12345678 }; |
| 12 |
|
| 13 |
unsigned char big_endian_pattern[4] = { 0x12, 0x34, 0x56, 0x78 }; |
| 14 |
unsigned char little_endian_pattern[4] = { 0x78, 0x56, 0x34, 0x12 }; |
| 15 |
|
| 16 |
int main (void) |
| 17 |
{ |
| 18 |
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 19 |
if (__builtin_memcmp (&my_s1, &little_endian_pattern, 4) != 0) |
| 20 |
__builtin_abort (); |
| 21 |
#else |
| 22 |
if (__builtin_memcmp (&my_s1, &big_endian_pattern, 4) != 0) |
| 23 |
__builtin_abort (); |
| 24 |
#endif |
| 25 |
|
| 26 |
return 0; |
| 27 |
} |