aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/inline.c')
-rw-r--r--test/CodeGen/inline.c91
1 files changed, 50 insertions, 41 deletions
diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c
index 442b38000b3c..70ab696b64ee 100644
--- a/test/CodeGen/inline.c
+++ b/test/CodeGen/inline.c
@@ -1,55 +1,64 @@
// RUN: echo "GNU89 tests:"
-// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
-// CHECK1: define i32 @foo()
-// CHECK1: define i32 @bar()
-// CHECK1: define void @unreferenced1()
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
+// CHECK1-LABEL: define i32 @foo()
+// CHECK1-LABEL: define i32 @bar()
+// CHECK1-LABEL: define void @unreferenced1()
// CHECK1-NOT: unreferenced2
-// CHECK1: define void @gnu_inline()
-// CHECK1: define i32 @test1
-// CHECK1: define i32 @test2
-// CHECK1: define void @test3()
-// CHECK1: define available_externally i32 @test4
-// CHECK1: define available_externally i32 @test5
-// CHECK1: define i32 @test6
-// CHECK1: define void @test7
+// CHECK1-LABEL: define void @gnu_inline()
+// CHECK1-LABEL: define i32 @test1
+// CHECK1-LABEL: define i32 @test2
+// CHECK1-LABEL: define void @test3()
+// CHECK1-LABEL: define available_externally i32 @test4
+// CHECK1-LABEL: define available_externally i32 @test5
+// CHECK1-LABEL: define i32 @test6
+// CHECK1-LABEL: define void @test7
// CHECK1: define i{{..}} @strlcpy
// CHECK1-NOT: test9
-// CHECK1: define void @testA
-// CHECK1: define void @testB
-// CHECK1: define void @testC
-// CHECK1: define available_externally void @gnu_ei_inline()
-// CHECK1: define available_externally i32 @ei()
+// CHECK1-LABEL: define void @testA
+// CHECK1-LABEL: define void @testB
+// CHECK1-LABEL: define void @testC
+// CHECK1-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK1-LABEL: define available_externally i32 @ei()
// RUN: echo "C99 tests:"
-// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
-// CHECK2: define i32 @ei()
-// CHECK2: define i32 @bar()
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
+// CHECK2-LABEL: define i32 @ei()
+// CHECK2-LABEL: define i32 @bar()
// CHECK2-NOT: unreferenced1
-// CHECK2: define void @unreferenced2()
-// CHECK2: define void @gnu_inline()
-// CHECK2: define i32 @test1
-// CHECK2: define i32 @test2
-// CHECK2: define void @test3
-// CHECK2: define available_externally i32 @test4
-// CHECK2: define available_externally i32 @test5
-// CHECK2: define i32 @test6
-// CHECK2: define void @test7
+// CHECK2-LABEL: define void @unreferenced2()
+// CHECK2-LABEL: define void @gnu_inline()
+// CHECK2-LABEL: define i32 @test1
+// CHECK2-LABEL: define i32 @test2
+// CHECK2-LABEL: define void @test3
+// CHECK2-LABEL: define available_externally i32 @test4
+// CHECK2-LABEL: define available_externally i32 @test5
+// CHECK2-LABEL: define i32 @test6
+// CHECK2-LABEL: define void @test7
// CHECK2: define available_externally i{{..}} @strlcpy
-// CHECK2: define void @test9
-// CHECK2: define void @testA
-// CHECK2: define void @testB
-// CHECK2: define void @testC
-// CHECK2: define available_externally void @gnu_ei_inline()
-// CHECK2: define available_externally i32 @foo()
+// CHECK2-LABEL: define void @test9
+// CHECK2-LABEL: define void @testA
+// CHECK2-LABEL: define void @testB
+// CHECK2-LABEL: define void @testC
+// CHECK2-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK2-LABEL: define available_externally i32 @foo()
// RUN: echo "C++ tests:"
-// RUN: %clang -x c++ %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=c++98 | FileCheck %s --check-prefix=CHECK3
-// CHECK3: define i32 @_Z3barv()
-// CHECK3: define linkonce_odr i32 @_Z3foov()
+// RUN: %clang_cc1 -x c++ %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=c++98 | FileCheck %s --check-prefix=CHECK3
+// CHECK3-LABEL: define i32 @_Z3barv()
+// CHECK3-LABEL: define linkonce_odr i32 @_Z3foov()
// CHECK3-NOT: unreferenced
-// CHECK3: define void @_Z10gnu_inlinev()
-// CHECK3: define available_externally void @_Z13gnu_ei_inlinev()
-// CHECK3: define linkonce_odr i32 @_Z2eiv()
+// CHECK3-LABEL: define void @_Z10gnu_inlinev()
+// CHECK3-LABEL: define available_externally void @_Z13gnu_ei_inlinev()
+// CHECK3-LABEL: define linkonce_odr i32 @_Z2eiv()
+
+// RUN: echo "MS C Mode tests:"
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-optzns -emit-llvm -o - -std=c99 -fms-compatibility | FileCheck %s --check-prefix=CHECK4
+// CHECK4-LABEL: define i32 @bar()
+// CHECK4-LABEL: define void @gnu_inline()
+// CHECK4-LABEL: define available_externally void @gnu_ei_inline()
+// CHECK4-LABEL: define linkonce_odr i32 @foo()
+// CHECK4-NOT: unreferenced
+// CHECK4-LABEL: define linkonce_odr i32 @ei()
extern __inline int ei() { return 123; }