blob: 66019b30f2ed90a2c928fa25847022f8efed1ab4 (
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
|
/* { dg-do compile } */
/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
void do_something (int shall_i_work)
{
if (shall_i_work)
{
work_hard ();
work_hard ();
work_hard ();
work_hard ();
work_hard ();
work_hard ();
work_hard ();
work_hard ();
}
}
int foo (int invariant)
{
do_something (0);
do_something (1);
}
/* We should inline do_something(0), but not do_something (1). */
/* { dg-final { scan-ipa-dump "Inlined 1 calls, eliminated 0 functions" "inline" } } */
/* Call to work_hard should be detected as optimized out. */
/* { dg-final { scan-ipa-dump-times "predicate: .false." 8 "inline" } } */
/* { dg-final { cleanup-ipa-dump "inline" } } */
|