Implement SSE4.2 optimized strchr and strrchr.
[glibc.git] / elf / ifuncmod5.c
blob2ca1c715410ce9b6705243cc58f31c990f143b52
1 /* Test STT_GNU_IFUNC symbols without direct function call. */
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 * foo_ifunc (void) __asm__ ("foo");
24 __asm__(".type foo, %gnu_indirect_function");
26 void *
27 foo_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 * foo_hidden_ifunc (void) __asm__ ("foo_hidden");
41 __asm__(".type foo_hidden, %gnu_indirect_function");
43 void *
44 foo_hidden_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 * foo_protected_ifunc (void) __asm__ ("foo_protected");
58 __asm__(".type foo_protected, %gnu_indirect_function");
60 void *
61 foo_protected_ifunc (void)
63 switch (global)
65 case 1:
66 return one;
67 case -1:
68 return zero;
69 default:
70 return minus_one;
74 /* Test hidden indirect function. */
75 __asm__(".hidden foo_hidden");
77 /* Test protected indirect function. */
78 __asm__(".protected foo_protected");