PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-2.c
bloba8f9d817fa801b380dbe928f915ac3b33bb8bc18
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fno-code-hoisting -fdump-tree-pre-stats" } */
3 int motion_test1(int data, int data_0, int data_3, int v)
5 int i;
6 int t, u;
8 if (data)
9 i = data_0 + data_3;
10 else {
11 v = 2;
12 i = 5;
14 t = data_0 + data_3;
15 u = i;
16 return v * t * u;
18 /* We should eliminate one computation of data_0 + data_3 along the
19 main path. We cannot re-associate v * t * u due to undefined
20 signed overflow so we do not eliminate one computation of v * i along
21 the main path. */
22 /* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre" { xfail *-*-* } } } */
23 /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */