1 /* { dg-do run } */
2 
3 #ifdef __SIZE_TYPE__
4 typedef __SIZE_TYPE__ uintptr_t;
5 #elif (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
6 typedef unsigned long long uintptr_t;
7 #elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
8 typedef unsigned long uintptr_t;
9 #elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
10 typedef unsigned int uintptr_t;
11 #else
12 #error Add target support here
13 #endif
14 
15 void __attribute__((noinline))
foo(uintptr_t l)16 foo(uintptr_t l)
17 {
18   int *p = (int *)l;
19   *p = 1;
20 }
21 
22 extern void abort (void);
main()23 int main()
24 {
25   int b = 0;
26   uintptr_t l = (uintptr_t)&b;
27   foo(l);
28   if (b != 1)
29     abort ();
30   return 0;
31 }
32