repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
opt
/
enum1.C
blob
6416b3f1b868dfbc62708a509c876983dc5fa82e
1
// Verify that we don't confuse precision and mode for enums.
2
// { dg-do run }
3
// { dg-options "-O" }
4
5
extern "C" void abort();
6
7
enum E {
8
zero = 0,
9
test = 0xbb
10
};
11
12
static bool foo(unsigned char *x)
13
{
14
E e = static_cast<E>(*x);
15
switch (e)
16
{
17
case test:
18
return true;
19
default:
20
return false;
21
}
22
}
23
24
int main()
25
{
26
unsigned char dummy = test;
27
if (! foo(&dummy))
28
abort ();
29
return 0;
30
}