xref: /llvm-project/lld/test/MachO/invalid/bad-archive.s (revision 7a4b27609d450d70fb072306446b1c0414066b74)
1## We're intentionally testing fatal errors (for malformed input files), and
2## fatal errors aren't supported for testing when main is run twice.
3# XFAIL: main-run-twice
4
5# REQUIRES: x86
6# RUN: echo "!<arch>" > %t.a
7# RUN: echo "foo" >> %t.a
8# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
9
10# RUN: not %lld %t.o %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s
11# RUN: not %lld %t.o -force_load %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s
12# RUN: not %lld %t.o -ObjC %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s
13# CHECK: error: [[FILE]]: failed to parse archive: truncated or malformed archive (remaining size of archive too small for next archive member header at offset 8)
14
15.global _main
16_main:
17  ret
18