URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
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
|
|
|
// token types: from state parser
|
// token types: from state parser
|
const int T_EOF = 257;
|
const int T_EOF = 257;
|
const int T_ERROR = 258;
|
const int T_ERROR = 258;
|
const int T_Float = 259;
|
const int T_Float = 259;
|
const int T_Int = 260;
|
const int T_Int = 260;
|
const int T_ID = 261;
|
const int T_ID = 261;
|
const int T_STRING = 262;
|
const int T_STRING = 262;
|
|
|
class Complex;
|
class Complex;
|
class State;
|
class State;
|
|
|
// token, from state parser.
|
// token, from state parser.
|
class ParseToken {
|
class ParseToken {
|
public:
|
public:
|
int tok;
|
int tok;
|
union {
|
union {
|
char cval;
|
char cval;
|
const char *sval;
|
const char *sval;
|
int intval;
|
int intval;
|
double doubleval;
|
double doubleval;
|
Complex* Complexval;
|
Complex* Complexval;
|
const State* s;
|
const State* s;
|
};
|
};
|
ParseToken () { tok = 0; intval = 0;}
|
ParseToken () { tok = 0; intval = 0;}
|
};
|
};
|
|
|
int
|
int
|
main () {
|
main () {
|
ParseToken a;
|
ParseToken a;
|
a.tok = T_Float;
|
a.tok = T_Float;
|
a.doubleval = 23.2;
|
a.doubleval = 23.2;
|
ParseToken b(a);
|
ParseToken b(a);
|
|
|
if (b.doubleval == 23.2)
|
if (b.doubleval == 23.2)
|
std::cout << "PASS\n";
|
std::cout << "PASS\n";
|
else
|
else
|
{
|
{
|
std::cout << "FAIL\n";
|
std::cout << "FAIL\n";
|
return 1;
|
return 1;
|
}
|
}
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.