URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
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 constructors
|
// GROUPS passed constructors
|
#include
|
#include
|
#include
|
#include
|
#include
|
#include
|
|
|
#define MAGIC 7654
|
#define MAGIC 7654
|
|
|
class complex {
|
class complex {
|
double re;
|
double re;
|
double im;
|
double im;
|
int magic;
|
int magic;
|
static int count;
|
static int count;
|
public:
|
public:
|
complex() { re=im=0; magic=MAGIC; }
|
complex() { re=im=0; magic=MAGIC; }
|
complex(double d) { re=d; im=0; magic=MAGIC; }
|
complex(double d) { re=d; im=0; magic=MAGIC; }
|
complex(double d, double d2) {re=d; im=d2; magic=MAGIC; }
|
complex(double d, double d2) {re=d; im=d2; magic=MAGIC; }
|
~complex() {if(magic!=MAGIC) {std::printf("FAIL\n"); std::exit(1);}}
|
~complex() {if(magic!=MAGIC) {std::printf("FAIL\n"); std::exit(1);}}
|
friend std::ostream& operator << (std::ostream& o, const complex& c)
|
friend std::ostream& operator << (std::ostream& o, const complex& c)
|
{ return o << "(" << c.re << "," << c.im << ")"; }
|
{ return o << "(" << c.re << "," << c.im << ")"; }
|
};
|
};
|
|
|
int complex::count=0;
|
int complex::count=0;
|
|
|
int main()
|
int main()
|
{
|
{
|
complex v[6] = {1, complex(1,2), complex(), 2 }; // ARM Sect. 12.6.1
|
complex v[6] = {1, complex(1,2), complex(), 2 }; // ARM Sect. 12.6.1
|
int i; // page 289
|
int i; // page 289
|
|
|
for(i=0; i<6; i++) ;
|
for(i=0; i<6; i++) ;
|
std::printf ("PASS\n");
|
std::printf ("PASS\n");
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.