repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
torture
/
pr60648.C
blob
5e391e72e353488d5b731eb9c10d5212d8bcd308
1
// PR target/60648
2
// { dg-do compile }
3
// { dg-additional-options "-fPIC" { target fpic } }
4
5
enum component
6
{
7
Ex,
8
Ez,
9
Hy,
10
Permeability
11
};
12
enum derived_component
13
{};
14
enum direction
15
{
16
X,
17
Y,
18
Z,
19
R,
20
P,
21
NO_DIRECTION
22
};
23
derived_component a;
24
component *b;
25
component c;
26
direction d;
27
inline direction fn1 (component p1)
28
{
29
switch (p1)
30
{
31
case 0:
32
return Y;
33
case 1:
34
return Z;
35
case Permeability:
36
return NO_DIRECTION;
37
}
38
return X;
39
}
40
41
inline component fn2 (direction p1)
42
{
43
switch (p1)
44
{
45
case 0:
46
case 1:
47
return component ();
48
case Z:
49
case R:
50
return component (1);
51
case P:
52
return component (3);
53
}
54
} // { dg-warning "control reaches end of non-void function" }
55
56
void fn3 ()
57
{
58
direction e;
59
switch (0)
60
case 0:
61
switch (a)
62
{
63
case 0:
64
c = Ex;
65
b[1] = Hy;
66
}
67
e = fn1 (b[1]);
68
b[1] = fn2 (e);
69
d = fn1 (c);
70
}