1 #if (__SIZEOF_INT__ == 4)
2 typedef int int32;
3 #elif (__SIZEOF_LONG__ == 4)
4 typedef long int32;
5 #else
6 #error Add target support for int32
7 #endif
ref(void)8 static int32 ref(void)
9 {
10   union {
11     char c[5];
12     int32 i;
13   } u;
14 
15   __builtin_memset (&u, 0, sizeof(u));
16   u.c[0] = 1;
17   u.c[1] = 2;
18   u.c[2] = 3;
19   u.c[3] = 4;
20 
21   return u.i;
22 }
23 
main()24 int main()
25 {
26   int32 b = ref();
27   if (b != 0x01020304
28       && b != 0x04030201)
29     abort ();
30   return 0;
31 }
32