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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [for1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/13865
2
// Bug: We were destroying 'a' before executing the loop.
3
 
4
// { dg-do run }
5
 
6
#include 
7
 
8
int i;
9
int r;
10
 
11
class A
12
{
13
public:
14
  A() { printf("A ctor\n"); }
15
  ~A()
16
  {
17
    printf("A dtor\n");
18
    if (i != 2)
19
      r = 1;
20
  }
21
};
22
 
23
int main(int argc, char **argv)
24
{
25
  for (A a; i < 2; ++i) {
26
    printf("iteration %d\n", i);
27
  }
28
 
29
  return r;
30
}

powered by: WebSVN 2.1.0

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