Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr19476-1.C
blobc65401412cfe203cc90c7fe51fd7a9442c913395
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-ccp1 -fdelete-null-pointer-checks" } */
3 /* { dg-skip-if "" keeps_null_pointer_checks } */
5 // See pr19476-5.C for a version without including <new>.
6 #include <new>
8 int f(){
9   return 33 + (0 == new(std::nothrow) int);
11 int g(){
12   return 42 + (0 == new int[50]);
15 /* { dg-final { scan-tree-dump     "return 42" "ccp1" } } */
16 /* { dg-final { scan-tree-dump-not "return 33" "ccp1" } } */