xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/inline2.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -O1 -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-GNU89 %s
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -O1 -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-C99 %s
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f0()
5f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f0()
6f4a2713aSLionel Sambuc int f0(void);
f0(void)7f4a2713aSLionel Sambuc int f0(void) { return 0; }
8f4a2713aSLionel Sambuc 
9f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f1()
10f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f1()
11f4a2713aSLionel Sambuc inline int f1(void);
f1(void)12f4a2713aSLionel Sambuc int f1(void) { return 0; }
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f2()
15f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f2()
16f4a2713aSLionel Sambuc int f2(void);
f2(void)17f4a2713aSLionel Sambuc inline int f2(void) { return 0; }
18f4a2713aSLionel Sambuc 
19f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f3()
20f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f3()
21f4a2713aSLionel Sambuc extern inline int f3(void);
f3(void)22f4a2713aSLionel Sambuc int f3(void) { return 0; }
23f4a2713aSLionel Sambuc 
24f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f5()
25f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f5()
26f4a2713aSLionel Sambuc extern inline int f5(void);
f5(void)27f4a2713aSLionel Sambuc inline int f5(void) { return 0; }
28f4a2713aSLionel Sambuc 
29f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f6()
30f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f6()
31f4a2713aSLionel Sambuc inline int f6(void);
f6(void)32f4a2713aSLionel Sambuc extern inline int f6(void) { return 0; }
33f4a2713aSLionel Sambuc 
34f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @f7()
35f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f7()
36f4a2713aSLionel Sambuc extern inline int f7(void);
f7(void)37f4a2713aSLionel Sambuc extern int f7(void) { return 0; }
38f4a2713aSLionel Sambuc 
39f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @fA()
fA(void)40f4a2713aSLionel Sambuc inline int fA(void) { return 0; }
41f4a2713aSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc // CHECK-GNU89-LABEL: define i32 @fB()
fB()43*0a6a1f1dSLionel Sambuc inline int fB() { return 0; }
44*0a6a1f1dSLionel Sambuc 
45f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define available_externally i32 @f4()
46f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f4()
47f4a2713aSLionel Sambuc int f4(void);
f4(void)48f4a2713aSLionel Sambuc extern inline int f4(void) { return 0; }
49f4a2713aSLionel Sambuc 
50f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define available_externally i32 @f8()
51f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f8()
52f4a2713aSLionel Sambuc extern int f8(void);
f8(void)53f4a2713aSLionel Sambuc extern inline int f8(void) { return 0; }
54f4a2713aSLionel Sambuc 
55f4a2713aSLionel Sambuc // CHECK-GNU89-LABEL: define available_externally i32 @f9()
56f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define i32 @f9()
57f4a2713aSLionel Sambuc extern inline int f9(void);
f9(void)58f4a2713aSLionel Sambuc extern inline int f9(void) { return 0; }
59f4a2713aSLionel Sambuc 
60f4a2713aSLionel Sambuc // CHECK-C99-LABEL: define available_externally i32 @fA()
61f4a2713aSLionel Sambuc 
62*0a6a1f1dSLionel Sambuc // CHECK-C99-LABEL: define i32 @fB()
63*0a6a1f1dSLionel Sambuc 
test_all()64f4a2713aSLionel Sambuc int test_all() {
65f4a2713aSLionel Sambuc   return f0() + f1() + f2() + f3() + f4() + f5() + f6() + f7() + f8() + f9()
66*0a6a1f1dSLionel Sambuc     + fA() + fB();
67f4a2713aSLionel Sambuc }
68*0a6a1f1dSLionel Sambuc 
69*0a6a1f1dSLionel Sambuc int fB(void);
70