File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
gcc/testsuite/gcc.dg/tree-prof Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* { dg-options "-O2 -fdump-ipa-afdo-details -fdump-tree-einline-details" } */
2
+ /* { dg-require-profiling "-fauto-profile" } */
3
+
4
+ volatile int array [1000 ];
5
+ int reta (int i )
6
+ {
7
+ return array [i ];
8
+ }
9
+ struct wrapptr
10
+ {
11
+ int (* ret )(int );
12
+ };
13
+ int test (struct wrapptr * p )
14
+ {
15
+ int s = 0 ;
16
+ for (int pos = 0 ; pos < 1000 ; pos ++ )
17
+ s + p -> ret (pos );
18
+ if (s )
19
+ __builtin_printf ("sum error\n" );
20
+ }
21
+ int main ()
22
+ {
23
+ struct wrapptr p = {reta };
24
+ for (int i = 0 ; i < 10000 ; i ++ )
25
+ test (& p );
26
+ return 0 ;
27
+ }
28
+ /* { dg-final-use-autofdo { scan-tree-dump "Inlining test" "einline"} } */
29
+ /* { dg-final-use-autofdo { scan-ipa-dump "Checking indirect call -> direct call reta" "afdo"} } */
30
+ /* { dg-final-use-autofdo { scan-ipa-dump "looks good" "afdo"} } */
31
+ /* If we inlined reta->test->main, it will contian array[pos]. */
32
+ /* { dg-final-use-autofdo { scan-ipa-dump "array.pos_" "afdo"} } */
You can’t perform that action at this time.
0 commit comments