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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [nrv6.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/9993
2
// Bug: We were failing to destroy b.
3
 
4
// { dg-do run }
5
 
6
int c, d;
7
 
8
struct Object {
9
  Object()                      { ++c; }
10
  Object(const Object&)         { ++c; }
11
  ~Object()                     { ++d; }
12
};
13
 
14
Object function() {
15
  int i = 0;
16
  do {
17
    Object b;
18
    if (i++ == 2)
19
      return b;
20
  } while (1);
21
}
22
 
23
int main() {
24
  function();
25
  return c != d;
26
}

powered by: WebSVN 2.1.0

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