re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr22051-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -w" } */
3
4
5
6
7 void *arf ();
8 int
9 foo()
10 {
11 void (*q)(void);
12 int r = q;
13
14 if (r != 0)
15 return 1;
16 else
17 return 2;
18 }
19
20 /* The cast to an int type must remain after all optimizations are complete
21 so that we do not try to canonicalize a function pointer for the
22 comparison when no such canonicalization is wanted. */
23 /* { dg-final { scan-tree-dump-times "if \\(\\(int\\).*q" 1 "optimized" } } */
24 /* { dg-final { cleanup-tree-dump "optimized" } } */
25