PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20040204-1.c
bloba1237cf839baa6f3c1c700051c193fef5c443fb6
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized" } */
4 extern void link_error (void);
6 /*
7 test that a condition is propagated inside an if
8 */
10 void test5 (int x)
12 extern int foo (int);
13 if (x == 0)
14 foo (x);
15 else if (x == 0 )
16 link_error ();
19 void test55 (int x, int y)
21 int u;
22 if (x == 5 && y)
24 u = x + 22;
25 if (u != 27)
26 link_error ();
30 /* There should be not link_error calls, if there is any the
31 optimization has failed */
32 /* ??? Ug. This one may or may not fail based on how fold decides
33 that the && should be emitted (based on BRANCH_COST). Fix this
34 by teaching dom to look through && and register all components
35 as true. */
36 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* aarch64*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* s390*-*-* sh*-*-* sparc*-*-* spu-*-* visium-*-* x86_64-*-* riscv*-*-*" } } } } */