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++.law/] [dtors3.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// GROUPS passed destructors
// GROUPS passed destructors
// dtor file
// dtor file
// Message-Id: <9301242117.AA04053@cs.rice.edu>
// Message-Id: <9301242117.AA04053@cs.rice.edu>
// From: dougm@cs.rice.edu (Doug Moore)
// From: dougm@cs.rice.edu (Doug Moore)
// Subject: 2.3.3: premature dtor of temp?
// Subject: 2.3.3: premature dtor of temp?
// Date: Sun, 24 Jan 93 15:17:07 CST
// Date: Sun, 24 Jan 93 15:17:07 CST
#include 
#include 
#include 
#include 
int killed = 0;
int killed = 0;
class Foo
class Foo
{
{
  int a;
  int a;
public:
public:
  Foo()
  Foo()
  :a(0) {;}
  :a(0) {;}
  ~Foo() { killed++;}
  ~Foo() { killed++;}
  Foo& operator << (int b)
  Foo& operator << (int b)
  {
  {
    a += b;
    a += b;
    if (killed)
    if (killed)
      {
      {
        printf ("FAIL\n");
        printf ("FAIL\n");
        exit (1);
        exit (1);
      }
      }
    return *this;
    return *this;
  }
  }
};
};
int main()
int main()
{
{
  Foo() << 1 << 3 << 5 << 7;
  Foo() << 1 << 3 << 5 << 7;
  printf ("PASS\n");
  printf ("PASS\n");
}
}
 
 

powered by: WebSVN 2.1.0

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