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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [misc14.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// GROUPS passed
3
extern "C" int printf (const char *, ...);
4
extern "C" void exit(int);
5
 
6
class A {
7
public:
8
  virtual ~A() {
9
    printf("FAIL\n");
10
    exit (1);
11
  }
12
};
13
 
14
class B : public A {
15
public:
16
  virtual ~B() {
17
    printf("PASS\n");
18
    exit (0);
19
  }
20
};
21
 
22
int main() {
23
  B b;
24
  A *ap = &b;
25
  ap->~A();  // This should call the destructor virtually.
26
  printf("FAIL\n");
27
  return 1;
28
}

powered by: WebSVN 2.1.0

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