blob: 6416b3f1b868dfbc62708a509c876983dc5fa82e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Verify that we don't confuse precision and mode for enums.
// { dg-do run }
// { dg-options "-O" }
extern "C" void abort();
enum E {
zero = 0,
test = 0xbb
};
static bool foo(unsigned char *x)
{
E e = static_cast<E>(*x);
switch (e)
{
case test:
return true;
default:
return false;
}
}
int main()
{
unsigned char dummy = test;
if (! foo(&dummy))
abort ();
return 0;
}
|