* lib/target-supports.exp (check_effective_target_size32plus):
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr36373-10.c
blobd18b4e8432ee2181456c963f46d594883de0a158
1 /* { dg-do run } */
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
15 void __attribute__((noinline))
16 foo(uintptr_t l)
18 int *p = (int *)l;
19 *p = 1;
22 extern void abort (void);
23 int main()
25 int b = 0;
26 uintptr_t l = (uintptr_t)&b;
27 foo(l);
28 if (b != 1)
29 abort ();
30 return 0;