re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / update-threading.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3
4 typedef struct { unsigned short a; } A;
5
6 extern void abort (void);
7 extern void exit (int);
8
9 void foo (unsigned int x)
10 {
11 if (x != 0x800 && x != 0x810)
12 abort ();
13 }
14
15 int
16 main (int argc, char **argv)
17 {
18 int i;
19 for (i = 0; i < 2; ++i)
20 foo (((A) { ((!(i >> 4) ? 8 : 64 + (i >> 4)) << 8) + (i << 4) } ).a);
21 exit (0);
22 }
23 /* { dg-final { scan-tree-dump-times "Invalid sum" 0 "optimized" { xfail *-*-* } } } */
24 /* { dg-final { cleanup-tree-dump "optimized" } } */