libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / crossmodule-indircall-1a.c
blob92237852ef17b6d17cfd1b484f38aa1fd7254193
1 /* It seems there is no way to avoid the other source of mulitple
2 source testcase from being compiled independently. Just avoid
3 error. */
4 #ifdef DOJOB
5 extern int a;
6 void abort (void);
8 #ifdef _PROFILE_USE
9 __attribute__ ((externally_visible))
10 int constval=1,constval2=2;
11 #else
12 __attribute__ ((externally_visible))
13 int constval=3,constval2=2;
14 #endif
17 void
18 add(int i)
20 /* Verify that inlining happens for first case. */
21 if (i==constval && !__builtin_constant_p (i))
22 abort ();
23 /* Second case has no dominating target; it should not inline. */
24 if (i==constval2 && __builtin_constant_p (i))
25 abort ();
26 a += i;
28 void
29 sub(int i)
31 a -= i;
33 void
34 add2(int i)
36 a -= 2*i;
38 void
39 sub2(int i)
41 a -= 2*i;
43 void
44 nothing(int i)
46 a -= i;
48 __attribute__ ((externally_visible))
49 void (*p[5])(int)={add, sub, add2, sub2, nothing};
50 #else
51 int
52 main()
54 return 0;
56 #endif