1 ## Show that the archive library emits error messages when adding malformed
5 # RUN: split-file %s %t.dir
8 ## Malformed bitcode object.
9 # RUN: llvm-as input.ll -o input.bc
10 # RUN: %python -c "with open('input.bc', 'a') as f: f.truncate(10)"
11 # RUN: not llvm-ar rc bad.a input.bc 2>&1 | FileCheck %s --check-prefix=ERR1
13 # ERR1: error: bad.a: Invalid bitcode signature
15 ## Non-bitcode malformed file.
16 # RUN: yaml2obj input.yaml -o input.o
17 # RUN: not llvm-ar rc bad.a input.o 2>&1 | FileCheck %s --check-prefix=ERR2
19 # ERR2: error: bad.a: section header table goes past the end of the file: e_shoff = 0x9999
21 ## Don't emit an error if the symbol table is not required.
22 # RUN: llvm-ar rcS good.a input.o input.bc
23 # RUN: llvm-ar t good.a | FileCheck %s --check-prefix=CONTENTS
26 # CONTENTS-NEXT: input.bc
29 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
30 target triple = "x86_64-pc-linux"