1 #if (__SIZEOF_INT__ == 2)
2 #define TESTVALUE 0x1234
3 #else
4 #define TESTVALUE 0x12345678
5 #endif
6 static void
foo(unsigned int x,void * p)7 foo (unsigned int x, void *p)
8 {
9   __builtin_memcpy (p, &x, sizeof x);
10 }
11 
12 void
bar(int type,void * number)13 bar (int type, void *number)
14 {
15   switch (type)
16     {
17     case 1:
18       foo (TESTVALUE, number);
19       break;
20     case 7:
21       foo (0, number);
22       break;
23     case 8:
24       foo (0, number);
25       break;
26     case 9:
27       foo (0, number);
28       break;
29     }
30 }
31 
32 int
main(void)33 main (void)
34 {
35   unsigned int x;
36   bar (1, &x);
37   if (x != TESTVALUE)
38     __builtin_abort ();
39   return 0;
40 }
41