[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / CodeGen / extern-inline.c
blob60f6d034bf1fda0cb22f5c92aced2ea28222fe2e
1 // RUN: %clang -S -emit-llvm -std=gnu89 -o - %s | FileCheck %s
2 // PR5253
4 // If an extern inline function is redefined, functions should call the
5 // redefinition.
6 extern inline int f(int a) {return a;}
7 int g(void) {return f(0);}
8 // CHECK: call i32 @f
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);}
13 // CHECK: call i32 @f
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