Debian Codegraph @

gcc/testsuite/gcc.dg/tree-prof/loop-split-2.c

raw
1 /* { dg-options "-O3 -fdump-tree-lsplit-details-blocks -fdump-tree-optimized-details-blocks" } */
2
3 int M = 100;
4
5 void
6 __attribute__ ((noinline,noipa))
7 do_something()
8 {
9 }
10 void
11 __attribute__ ((noinline,noipa))
12 do_something2()
13 {
14 }
15
16 __attribute__ ((noinline,noipa))
17 void test1 (int n)
18 {
19 if (n <= 0 || n > 100000)
20 return;
21 for (int i = 0; i <= n; i++)
22 if (i < n)
23 do_something ();
24 else
25 do_something2 ();
26 }
27 int
28 main(int, char **)
29 {
30 for (int i = 0 ; i < 1000; i++)
31 test1(M);
32 return 0;
33 }
34 /* { dg-final-use-not-autofdo { scan-tree-dump-times "Loop split" 1 "lsplit" } } */
35 /* { dg-final-use-not-autofdo { scan-tree-dump-times "Invalid sum" 0 "lsplit" } } */
36 /* { dg-final-use-not-autofdo { scan-tree-dump-times "Invalid sum" 0 "optimized" } } */