]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
13d2916c47b9f0b358fe455088b6e17e3a6ad60f
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / attr-hotcold-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-profile_estimate-blocks-details" } */
3
4 void g(void);
5 void h(void);
6 void f(int x, int y)
7 {
8 if (x) goto A;
9 if (y) goto B;
10 return;
11
12 A: __attribute__((cold))
13 g();
14 return;
15
16 B: __attribute__((hot))
17 h();
18 return;
19 }
20
21 /* { dg-final { scan-tree-dump-times "hot label heuristics" 1 "profile_estimate" } } */
22 /* { dg-final { scan-tree-dump-times "cold label heuristics" 1 "profile_estimate" } } */
23 /* { dg-final { scan-tree-dump-times "block 4, loop depth 0, count 0, freq \[1-4\]\[^0-9\]" 3 "profile_estimate" } } */
24
25 /* Note: we're attempting to match some number > 6000, i.e. > 60%.
26 The exact number ought to be tweekable without having to juggle
27 the testcase around too much. */
28 /* { dg-final { scan-tree-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 3 "profile_estimate" } } */