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