llvm-project/lld/test/MachO/invalid/cstring-dedup.s
Shoaib Meenai 7a4b27609d [lld] Add test suite mode for running LLD main twice
LLD_IN_TEST determines how many times each port's `main` function is
run in each LLD process, and setting LLD_IN_TEST=2 (or higher) is useful
for checking if we're cleaning up and resetting global state correctly.
Add a test suite parameter to enable this easily. There's work in
progress to remove global state (e.g. D108850), but this seems useful in
the interim.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D112898
2021-11-01 14:26:54 -07:00

26 lines
942 B
ArmAsm

## We're intentionally testing fatal errors (for malformed input files), and
## fatal errors aren't supported for testing when main is run twice.
# XFAIL: main-run-twice
# REQUIRES: x86
# RUN: rm -rf %t; split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/not-terminated.s -o %t/not-terminated.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/relocs.s -o %t/relocs.o
# RUN: not %lld -dylib --deduplicate-literals %t/not-terminated.o 2>&1 | FileCheck %s --check-prefix=TERM
# RUN: not %lld -dylib --deduplicate-literals %t/relocs.o 2>&1 | FileCheck %s --check-prefix=RELOCS
# TERM: not-terminated.o:(__cstring): string is not null terminated
# RELOCS: relocs.o contains relocations in __TEXT,__cstring, so LLD cannot deduplicate literals. Try re-running without --deduplicate-literals.
#--- not-terminated.s
.cstring
.asciz "foo"
.ascii "oh no"
#--- relocs.s
.cstring
_str:
.asciz "foo"
.quad _str