Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr33593.C
blob2cc10778ad92298a244f913198291fcf2fc1af27
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" } }