xref: /aosp_15_r20/external/llvm/test/Bitcode/padding.test (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerTest that both llvm-dis (uses a data streamer) and opt (no data streamer)
2*9880d681SAndroid Build Coastguard Workerhandle a .bc file with any padding.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard WorkerA file padded with '\n' can be produced under a peculiar situation:
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker* A .bc is produced os OS X, but without a darwin triple, so it has no
7*9880d681SAndroid Build Coastguard Worker  wrapper.
8*9880d681SAndroid Build Coastguard Worker* It is included in a .a archive
9*9880d681SAndroid Build Coastguard Worker* ranlib is ran on that archive. It will pad the members to make them multiple
10*9880d681SAndroid Build Coastguard Worker  of 8 bytes.
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerand there is no reason to not handle the general case.
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dis -disable-output %p/Inputs/padding.bc
15*9880d681SAndroid Build Coastguard WorkerRUN: opt -disable-output %p/Inputs/padding.bc
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dis -disable-output %p/Inputs/padding-garbage.bc
18*9880d681SAndroid Build Coastguard WorkerRUN: opt -disable-output %p/Inputs/padding-garbage.bc
19