1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-tree-optimized -fdelete-null-pointer-checks" } */ 3 /* { dg-skip-if "" keeps_null_pointer_checks } */ 4 5 #include <new> 6 f()7int f(){ 8 int *p = new(std::nothrow) int; 9 return 33 + (0 == p); 10 } g()11int g(){ 12 int *p = new int[50]; 13 return 42 + (0 == p); 14 } 15 16 /* { dg-final { scan-tree-dump "return 42" "optimized" } } */ 17 /* { dg-final { scan-tree-dump-not "return 33" "optimized" } } */ 18