Merge remote branch 'origin/master'
[binutils/dougsmingw.git] / ld / testsuite / ld-ifunc / prog.c
blobda786a52d377235af91d642d94c2692236f1ef4d
1 extern int printf (const char *, ...);
3 extern int library_func1 (void);
4 extern int library_func2 (void);
5 extern int global;
7 int
8 main (void)
10 int res = -1;
12 res += library_func1 ();
13 res += library_func2 ();
15 switch (res)
17 case 0:
18 if (global)
19 printf ("ifunc working correctly\n");
20 else
22 printf ("wrong value returned by library_func2\n");
23 res = -1;
25 break;
27 case 1:
28 if (global)
29 printf ("wrong value returned by library_func2\n");
30 else
32 printf ("ifunc working correctly\n");
33 res = 0;
35 break;
37 case 4:
38 printf ("non-ifunc testcase\n");
39 break;
41 default:
42 printf ("ifunc function not evaluated at run-time, res = %x\n", res);
43 break;
45 return res;