OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [dtor2.C] - Rev 774

Go to most recent revision | Compare with Previous | Blame | View Log

// PR c++/12751
// tree-ssa eh lowering bug ran a destructor twice for one object
// { dg-do run }

static int check;

struct Y {
  Y();
  ~Y();
};

void foo() {
  Y y1;
  Y y2;
  switch(0) {
    case 1: {
        Y y3;
        return;
      }
  }
}

Y::Y() { ++check; }
Y::~Y() { --check; }

int main()
{
  foo ();
  return check;
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.