1 // RUN: %clang_cc1 -no-opaque-pointers -triple i386-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -no-opaque-pointers -triple i386-unknown-linux-gnu -O2 -emit-llvm -o - %s | FileCheck %s
4 int foo(int) __attribute__ ((ifunc("foo_ifunc")));
10 static int f2(int i
) {
14 typedef int (*foo_t
)(int);
18 static foo_t
foo_ifunc(void) {
19 return global
? f1
: f2
;
26 extern void goo(void);
32 extern void goo(void) __attribute__ ((ifunc("goo_ifunc")));
34 void* goo_ifunc(void) {
37 // CHECK: @foo = ifunc i32 (i32), i32 (i32)* ()* @foo_ifunc
38 // CHECK: @goo = ifunc void (), bitcast (i8* ()* @goo_ifunc to void ()* ()*)
40 // CHECK: call i32 @foo(i32
41 // CHECK: call void @goo()