libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / loop-split-3.c
bloba88bc1f8663aad2d5f7a76804dbf417aa3b39e10
1 /* { dg-options "-O3 -fdump-tree-lsplit-details-blocks -fdump-tree-optimized-details-blocks" } */
3 int M = 100;
4 int a[1000];
6 void
7 __attribute__ ((noinline,noipa))
8 do_something()
11 void
12 __attribute__ ((noinline,noipa))
13 do_something2()
17 __attribute__ ((noinline,noipa))
18 void test1 (int n)
20 if (n <= 0 || n > 100000)
21 return;
22 for (int i = 0; i <= n; i++)
24 if (i < n)
25 do_something ();
26 if (a[i])
27 do_something2();
30 int
31 main(int, char **)
33 for (int i = 0 ; i < 1000; i+=3)
34 a[i]=1;
35 for (int i = 0 ; i < 1000; i++)
36 test1(M);
37 return 0;
39 /* { dg-final-use-not-autofdo { scan-tree-dump-times "Loop split" 1 "lsplit" } } */
40 /* { dg-final-use-not-autofdo { scan-tree-dump-times "Invalid sum" 0 "lsplit" } } */
41 /* { dg-final-use-not-autofdo { scan-tree-dump-times "Invalid sum" 0 "optimized" } } */