gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-27.c
blob4149bbef6a5d8f806dde67ab83e5c3b357824dff
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre" } */
4 int foo (int i, int j, int b)
6 int res = 0;
7 if (b)
8 res = i/j;
9 /* We should insert the possibly trapping i/j. */
10 res += i/j;
11 return res;
14 extern void bar (void);
15 int foo2 (int i, int j, int b)
17 int res = 0;
18 if (b)
19 res = i/j;
20 /* And here, the possibly not returning call in the same basic-block
21 comes after the trapping i/j. */
22 res += i/j;
23 bar ();
24 return res;
27 /* { dg-final { scan-tree-dump-times "# prephitmp" 2 "pre" } } */
28 /* { dg-final { cleanup-tree-dump "pre" } } */