aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr19476-2.C
blob: 70002dbb5ea2edb54c6fd1323dad3210f95e31a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

#include <new>

int f(){
  int *p = new(std::nothrow) int;
  return 33 + (0 == p);
}
int g(){
  int *p = new int[50];
  return 42 + (0 == p);
}

/* { dg-final { scan-tree-dump     "return 42" "optimized" } } */
/* { dg-final { scan-tree-dump-not "return 33" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */