summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr45412.C
blob: e374f52b51d57c6ab756bbb1a0d6723d1ae5d598 (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
// { dg-do compile }
// { dg-options "-O2 -fipa-cp-clone -ftracer" }

int foo (int *);
void bar ();

struct S
{
  virtual int vm ();
  ~S ();
};

int
S::vm ()
{
  int state;
  switch (foo (&state))
    {
      case 0:
	  bar ();
      case 1:
	  delete this;
    }
  return state;
}