mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-23 12:40:38 +00:00
0c650627ca
Before this patch the bitcode reader would read a module from a file that contained in order: * Any number of non MODULE_BLOCK sub blocks. * One MODULE_BLOCK * Any number of non MODULE_BLOCK sub blocks. * 4 '\n' characters to handle OS X's ranlib. Since we support lazy reading of modules, any information that is relevant for the module has to be in the MODULE_BLOCK or before it. We don't gain anything from checking what is after. This patch then changes the reader to stop once the MODULE_BLOCK has been successfully parsed. This avoids the ugly special case for .bc files in an archive and makes it easier to embed bitcode files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239845 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
656 B
Plaintext
19 lines
656 B
Plaintext
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
|