blob: 6a27b69c5babaefab1c778f6d541ff8d14938d4a [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* Used by the elf ifunc tests. */
2#ifndef ELF_IFUNC_SEL_H
3#define ELF_IFUNC_SEL_H 1
4
5extern int global;
6
7static inline void *
8ifunc_sel (int (*f1) (void), int (*f2) (void), int (*f3) (void))
9{
10 switch (global)
11 {
12 case 1:
13 return f1;
14 case -1:
15 return f2;
16 default:
17 return f3;
18 }
19}
20
21static inline void *
22ifunc_one (int (*f1) (void))
23{
24 return f1;
25}
26#endif