2.10.90-26
[glibc.git] / elf / ifuncdep2.c
blobfb21eef5cb095827a83376f7360dd52958241a8b
1 /* Test 3 STT_GNU_IFUNC symbols. */
3 extern int global;
5 static int
6 one (void)
8 return 1;
11 static int
12 minus_one (void)
14 return -1;
17 static int
18 zero (void)
20 return 0;
23 void * foo1_ifunc (void) __asm__ ("foo1");
24 __asm__(".type foo1, %gnu_indirect_function");
26 void *
27 foo1_ifunc (void)
29 switch (global)
31 case 1:
32 return one;
33 case -1:
34 return minus_one;
35 default:
36 return zero;
40 void * foo2_ifunc (void) __asm__ ("foo2");
41 __asm__(".type foo2, %gnu_indirect_function");
43 void *
44 foo2_ifunc (void)
46 switch (global)
48 case 1:
49 return minus_one;
50 case -1:
51 return one;
52 default:
53 return zero;
57 void * foo3_ifunc (void) __asm__ ("foo3");
58 __asm__(".type foo3, %gnu_indirect_function");
60 void *
61 foo3_ifunc (void)
63 switch (global)
65 case 1:
66 return one;
67 case -1:
68 return zero;
69 default:
70 return minus_one;