blob: a1edb910e9de27ea2a1c0a7bdde73a149fc775b6 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/* { dg-do compile } */
/* { dg-options -O2 } */
extern void do_something_usefull();
/* Check that we finish compiling even if instructed to
flatten a cyclic callgraph. Verify we correctly
flatten with another function marked flatten in the
callgraph. */
void __attribute__((flatten)) direct(void)
{
direct();
}
void __attribute__((flatten)) indirect(void);
static void indirect1(void)
{
indirect();
}
void __attribute__((flatten)) indirect(void)
{
indirect1();
}
void __attribute__((flatten)) doubleindirect(void);
static void doubleindirect2(void)
{
doubleindirect();
do_something_usefull ();
}
static void doubleindirect1(void)
{
doubleindirect2();
}
void __attribute__((flatten)) doubleindirect(void)
{
doubleindirect1();
}
static void subcycle1(void);
static void subcycle2(void)
{
subcycle1();
do_something_usefull ();
}
static void subcycle1(void)
{
subcycle2();
}
void __attribute__((flatten)) subcycle(void)
{
subcycle1();
}
static void doublesubcycle1(void);
static void doublesubcycle2(void);
static void doublesubcycle3(void)
{
doublesubcycle1();
do_something_usefull ();
}
static void doublesubcycle2(void)
{
doublesubcycle3();
}
static void doublesubcycle1(void)
{
doublesubcycle2();
}
void __attribute__((flatten)) doublesubcycle(void)
{
doublesubcycle1();
}
/* { dg-final { scan-assembler "cycle\[123\]\[: \t\n\]" } } */
|