URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// Verify that we don't confuse precision and mode for enums.
|
// Verify that we don't confuse precision and mode for enums.
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-O" }
|
// { dg-options "-O" }
|
|
|
extern "C" void abort();
|
extern "C" void abort();
|
|
|
enum E {
|
enum E {
|
zero = 0,
|
zero = 0,
|
test = 0xbb
|
test = 0xbb
|
};
|
};
|
|
|
static bool foo(unsigned char *x)
|
static bool foo(unsigned char *x)
|
{
|
{
|
E e = static_cast(*x);
|
E e = static_cast(*x);
|
switch (e)
|
switch (e)
|
{
|
{
|
case test:
|
case test:
|
return true;
|
return true;
|
default:
|
default:
|
return false;
|
return false;
|
}
|
}
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
unsigned char dummy = test;
|
unsigned char dummy = test;
|
if (! foo(&dummy))
|
if (! foo(&dummy))
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.