From 35f6faed67cf894bb1a8272c0e6cdc975f6cb7ae Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 16 Jun 2015 16:36:15 +0000 Subject: [PATCH] Add a test for padded bitcode files. llvm-svn: 239829 --- llvm/test/Bitcode/Inputs/padding.bc | Bin 0 -> 424 bytes llvm/test/Bitcode/padding.test | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 llvm/test/Bitcode/Inputs/padding.bc create mode 100644 llvm/test/Bitcode/padding.test diff --git a/llvm/test/Bitcode/Inputs/padding.bc b/llvm/test/Bitcode/Inputs/padding.bc new file mode 100644 index 0000000000000000000000000000000000000000..7654a3e5da214ab57ab4efeb0e761db0cb829805 GIT binary patch literal 424 zcmZ>AK5$Qwhk+rDfq{X$Nr8b0NDBiod!zD1#}h1`Yyw7>lNeigR9QJBrB$Q*en zlP1Dw+u>}{a=6E-fxWVVy?90;&oc)8w*q`$8u*NPoa7E2ls&glCe45qtgKo3472SC zXWJfT+cOnCB?au&9PE`I?F9wwRRzpt73~EI?UH8%`QA+6duYI)XTbmX1K)=LK4XC+ zviB5aZYatgN|Z}8=(OI`Y<{@I(9%Cm)>oLVH!y=jgn@wz2mmAQ Bj7tCj literal 0 HcmV?d00001 diff --git a/llvm/test/Bitcode/padding.test b/llvm/test/Bitcode/padding.test new file mode 100644 index 000000000000..72fe42ea47e6 --- /dev/null +++ b/llvm/test/Bitcode/padding.test @@ -0,0 +1,13 @@ +Test that both llvm-dis (uses a data streamer) and opt (no data streamer) +handle a .bc file padded with '\n' at the end. + +This files 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. + +RUN: llvm-dis -disable-output %p/Inputs/padding.bc +RUN: opt -disable-output %p/Inputs/padding.bc