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

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// GROUPS passed copy-ctors
// GROUPS passed copy-ctors
#include 
#include 
int pass = 0;
int pass = 0;
class name {
class name {
  int namestuff;
  int namestuff;
public:
public:
  name() {
  name() {
    namestuff = 111;
    namestuff = 111;
  }
  }
  name(const name& subject);
  name(const name& subject);
  name & operator = (const name& right) {
  name & operator = (const name& right) {
    this->namestuff = right.namestuff;
    this->namestuff = right.namestuff;
    return *this;
    return *this;
  }
  }
  ~name() {
  ~name() {
    ;
    ;
  }
  }
};
};
name::name(const name& subject) {
name::name(const name& subject) {
    pass = 1;
    pass = 1;
}
}
class person {
class person {
  int personstuff;
  int personstuff;
  name personname;
  name personname;
public:
public:
  person() {
  person() {
    ;
    ;
    personstuff = 222;
    personstuff = 222;
  }
  }
  ~person() {
  ~person() {
    ;
    ;
  }
  }
  void print() {
  void print() {
    ;
    ;
  }
  }
};
};
void
void
test(person argp)
test(person argp)
{
{
  person testp;
  person testp;
  ;
  ;
  argp.print();
  argp.print();
  testp = argp;
  testp = argp;
  argp.print();
  argp.print();
  testp.print();
  testp.print();
  ;
  ;
}
}
int main()
int main()
{
{
  person mainp;
  person mainp;
  test(mainp);
  test(mainp);
  if (pass)
  if (pass)
    printf ("PASS\n");
    printf ("PASS\n");
  else
  else
    { printf ("FAIL\n"); return 1; }
    { printf ("FAIL\n"); return 1; }
}
}
 
 

powered by: WebSVN 2.1.0

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