Warn pointer to signed integer cast for ilp32
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr23086.c
blob206b92de147e5bf9b14ebbebee08cf9d33e196d8
1 /* { dg-do run } */
2 /* { dg-options "-O -fdump-tree-optimized" } */
4 extern void link_error (void);
5 extern void abort (void);
7 int *t;
8 int __attribute__((noinline)) g(int *a)
10 t = a;
11 *a = 2;
14 void __attribute__((noinline)) f(int *a)
16 int b;
17 b = 1;
18 g(&b);
19 b = 2;
20 *a = 1;
21 if (b != 2)
22 link_error();
25 int main(void)
27 int t;
28 f(&t);
29 if (t != 1)
30 abort ();
31 return 0;
34 /* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
35 /* { dg-final { cleanup-tree-dump "optimized" } } */