OSDN Git Service

497b0a9807a846457212db4f1eb76c62c94e1435
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / torture / pr45982.c
1 /* { dg-do run } */
2
3 #include <stdint.h>
4
5 extern void abort (void);
6
7 uintptr_t __attribute__((pure,noinline,noclone))
8 foo (int *a)
9 {
10   return (uintptr_t) a;
11 }
12
13 void __attribute__((noinline,noclone))
14 bar (uintptr_t a)
15 {
16   int *p = (int *)a;
17   *p = 1;
18 }
19
20 int main()
21 {
22   int t = 0;
23   bar (foo (&t));
24   if (t != 1)
25     abort ();
26   return 0;
27 }