1 // RUN: %clang -S -emit-llvm -std=gnu89 -o - %s | FileCheck %s
4 // If an extern inline function is redefined, functions should call the
6 extern inline int f(int a
) {return a
;}
7 int g(void) {return f(0);}
9 int f(int b
) {return 1+b
;}
10 // CHECK: load i32* %{{.*}}
11 // CHECK: add nsw i32 1, %{{.*}}
12 int h(void) {return f(1);}
15 // It shouldn't matter if the function was redefined static.
16 extern inline int f2(int a
, int b
) {return a
+b
;}
17 int g2(void) {return f2(0,1);}
18 // CHECK: call i32 @f2
19 static int f2(int a
, int b
) {return a
*b
;}
20 // CHECK: load i32* %{{.*}}
21 // CHECK: load i32* %{{.*}}
22 // CHECK: mul nsw i32 %{{.*}}, %{{.*}}
23 int h2(void) {return f2(1,2);}
24 // CHECK: call i32 @f2