aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/new1.C
blob: a859f0ac3775225b9a12e63002dfa2ddcfd76944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// PR c++/36633

/* { dg-do compile } */
/* { dg-options "-O2 -Wall -fdump-tree-forwprop1" } */
// No particular reason for choosing forwprop1 dump to look at.

struct B { ~B() {} };
struct D : public B {};
//struct D {};

struct my_deleter
{
  void operator()(D * d)
  {
    //    delete [] d;
  }
};

struct smart_ptr
{
  smart_ptr(D * ptr) : p(ptr) { }
  ~smart_ptr() { d(p); }
  D * p;
  my_deleter d;  
};

int
test01()
{
  smart_ptr p(new D[7]);

  return 0;
}

int main()
{
  test01();
  return 0;
}

/* { dg-final { scan-tree-dump-not "= .* \\+ -" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */