Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr19476-2.C
blob0f657d5bd0cafffae9140bd31ead4495f725fb13
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -fdelete-null-pointer-checks" } */
3 /* { dg-skip-if "" keeps_null_pointer_checks } */
5 #include <new>
7 int f(){
8   int *p = new(std::nothrow) int;
9   return 33 + (0 == p);
11 int g(){
12   int *p = new int[50];
13   return 42 + (0 == p);
16 /* { dg-final { scan-tree-dump     "return 42" "optimized" } } */
17 /* { dg-final { scan-tree-dump-not "return 33" "optimized" } } */