111
|
1 /* { dg-do link } */
|
|
2 /* { dg-options "-O2" } */
|
|
3
|
|
4 extern void link_error (void);
|
|
5
|
|
6 typedef unsigned char(*Calculable)(void);
|
|
7
|
|
8 static unsigned char one() { return 1; }
|
|
9 static unsigned char two() { return 2; }
|
|
10
|
|
11 static int
|
|
12 print(Calculable calculate)
|
|
13 {
|
|
14 return calculate() + calculate() + 1;
|
|
15 }
|
|
16
|
|
17 int
|
|
18 main()
|
|
19 {
|
|
20 /* Make sure we perform indirect inlining of one and two and optimize
|
|
21 the result to a constant. */
|
|
22 if (print(one) != 3)
|
|
23 link_error ();
|
|
24 if (print(two) != 5)
|
|
25 link_error ();
|
|
26 return 0;
|
|
27 }
|