Merge from trunk @ 138209
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr36373-10.c
blobed701772828267dd33e98d6f727c862cb4333615
1 /* { dg-do run } */
3 #if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
4 typedef unsigned long long uintptr_t;
5 #elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
6 typedef unsigned long uintptr_t;
7 #elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
8 typedef unsigned int uintptr_t;
9 #else
10 #error Add target support here
11 #endif
13 void __attribute__((noinline))
14 foo(uintptr_t l)
16 int *p = (int *)l;
17 *p = 1;
20 extern void abort (void);
21 int main()
23 int b = 0;
24 uintptr_t l = (uintptr_t)&b;
25 foo(l);
26 if (b != 1)
27 abort ();
28 return 0;