* gcc.dg/ipa/inline-2.c: Fix implicit declarations.
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipacost-1.c
blob70c635e6bba0d3515fe0987c88a05a7be30336a0
1 /* { dg-do compile } */
2 /* { dg-options "-Os -fipa-cp -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */
4 int array[100];
6 int t(int);
8 static int
9 i_can_be_propagated_fully (int *a)
11 int i;
12 for (i=0;i<50;i++)
14 t(a[i]);
15 t(a[i+1]);
16 t(a[i+2]);
17 t(a[i+3]);
20 static int
21 i_can_be_propagated_fully2 (int *a)
23 i_can_be_propagated_fully (a);
24 i_can_be_propagated_fully (a);
25 i_can_be_propagated_fully (a);
27 static int
28 i_can_not_be_propagated_fully (int *a)
30 int i;
31 for (i=0;i<50;i++)
33 t(a[i]);
34 t(a[i+1]);
35 t(a[i+2]);
36 t(a[i+3]);
39 int
40 i_can_not_be_propagated_fully2 (int *a)
42 i_can_not_be_propagated_fully (a);
43 i_can_not_be_propagated_fully (a);
44 i_can_not_be_propagated_fully (a);
46 int
47 main()
49 i_can_be_propagated_fully2 (array);
50 i_can_be_propagated_fully2 (array);
51 i_can_not_be_propagated_fully2 (array);
52 i_can_not_be_propagated_fully2 (array);
55 /* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */
56 /* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */
57 /* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */
58 /* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */
59 /* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully " "optimized" } } */
60 /* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 " "optimized" } } */
61 /* { dg-final { cleanup-ipa-dump "cp" } } */
62 /* { dg-final { cleanup-tree-dump "optimized" } } */