summaryrefslogtreecommitdiff
path: root/test/Bitcode
diff options
context:
space:
mode:
Diffstat (limited to 'test/Bitcode')
-rw-r--r--test/Bitcode/Inputs/padding-garbage.bcbin0 -> 428 bytes
-rw-r--r--test/Bitcode/Inputs/padding.bcbin0 -> 424 bytes
-rw-r--r--test/Bitcode/miscInstructions.3.2.ll12
-rw-r--r--test/Bitcode/padding.test18
4 files changed, 27 insertions, 3 deletions
diff --git a/test/Bitcode/Inputs/padding-garbage.bc b/test/Bitcode/Inputs/padding-garbage.bc
new file mode 100644
index 000000000000..b44b584f4dc3
--- /dev/null
+++ b/test/Bitcode/Inputs/padding-garbage.bc
Binary files differ
diff --git a/test/Bitcode/Inputs/padding.bc b/test/Bitcode/Inputs/padding.bc
new file mode 100644
index 000000000000..7654a3e5da21
--- /dev/null
+++ b/test/Bitcode/Inputs/padding.bc
Binary files differ
diff --git a/test/Bitcode/miscInstructions.3.2.ll b/test/Bitcode/miscInstructions.3.2.ll
index bed26c22147d..6b8995107264 100644
--- a/test/Bitcode/miscInstructions.3.2.ll
+++ b/test/Bitcode/miscInstructions.3.2.ll
@@ -13,27 +13,33 @@ entry:
ret i32 0
}
+; CHECK-LABEL: define void @landingpadInstr1
+; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
define void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
entry:
-; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: %res = landingpad { i8*, i32 }
%res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
; CHECK: catch i8** @_ZTIi
catch i8** @_ZTIi
ret void
}
+; CHECK-LABEL: define void @landingpadInstr2
+; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
define void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
entry:
-; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: %res = landingpad { i8*, i32 }
%res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
; CHECK: cleanup
cleanup
ret void
}
+; CHECK-LABEL: define void @landingpadInstr3
+; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
define void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
entry:
-; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: %res = landingpad { i8*, i32 }
%res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
; CHECK: catch i8** @_ZTIi
catch i8** @_ZTIi
diff --git a/test/Bitcode/padding.test b/test/Bitcode/padding.test
new file mode 100644
index 000000000000..63b2fec2b59e
--- /dev/null
+++ b/test/Bitcode/padding.test
@@ -0,0 +1,18 @@
+Test that both llvm-dis (uses a data streamer) and opt (no data streamer)
+handle a .bc file with any padding.
+
+A file padded with '\n' can be produced under a peculiar situation:
+
+* A .bc is produced os OS X, but without a darwin triple, so it has no
+ wrapper.
+* It is included in a .a archive
+* ranlib is ran on that archive. It will pad the members to make them multiple
+ of 8 bytes.
+
+and there is no reason to not handle the general case.
+
+RUN: llvm-dis -disable-output %p/Inputs/padding.bc
+RUN: opt -disable-output %p/Inputs/padding.bc
+
+RUN: llvm-dis -disable-output %p/Inputs/padding-garbage.bc
+RUN: opt -disable-output %p/Inputs/padding-garbage.bc