Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr33593.C
blobf5497407ff8540530bd7ec0e3f4b858ab4fd7455
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fnon-call-exceptions -fdump-tree-optimized" } */
4 #include <stdio.h>
6 void foo (int) { printf ("Bar\n"); }
8 int
9 main (void)
11   int a = 1 / 0;        // { dg-warning "division by zero" }
12   printf ("Foo\n");
13   foo (a);
16 // The expression 1 / 0 should not be propagated into the call to foo() if it
17 // may trap.
18 // { dg-final { scan-tree-dump-times "foo \\(1 \\/ 0\\)" 0 "optimized" } }
19 // { dg-final { cleanup-tree-dump "optimized" } }