blob: 63b2fec2b59ee2a8879a1397a14fce47f914c9be [file] [log] [blame]
Rafael Espindola0021a542015-06-16 16:36:15 +00001Test that both llvm-dis (uses a data streamer) and opt (no data streamer)
Rafael Espindola0c650622015-06-16 20:03:39 +00002handle a .bc file with any padding.
Rafael Espindola0021a542015-06-16 16:36:15 +00003
Rafael Espindola0c650622015-06-16 20:03:39 +00004A file padded with '\n' can be produced under a peculiar situation:
Rafael Espindola0021a542015-06-16 16:36:15 +00005
6* A .bc is produced os OS X, but without a darwin triple, so it has no
7 wrapper.
8* It is included in a .a archive
9* ranlib is ran on that archive. It will pad the members to make them multiple
10 of 8 bytes.
11
Rafael Espindola0c650622015-06-16 20:03:39 +000012and there is no reason to not handle the general case.
13
Rafael Espindola0021a542015-06-16 16:36:15 +000014RUN: llvm-dis -disable-output %p/Inputs/padding.bc
15RUN: opt -disable-output %p/Inputs/padding.bc
Rafael Espindola0c650622015-06-16 20:03:39 +000016
17RUN: llvm-dis -disable-output %p/Inputs/padding-garbage.bc
18RUN: opt -disable-output %p/Inputs/padding-garbage.bc