Skip to content

Commit

Permalink
[lld-macho,test] Adjust reproduce-thin-archive-objc.s
Browse files Browse the repository at this point in the history
When `cd %t` is used, it's conventional to move it above and omit `-o /dev/null`.

We don't check the string before `warning:` since (a) the string is not
very useful and (b) downstream might customize `ctx->e.logName`
(argv[0]).

count 0 is better than `--allow-empty`. In addition, without `2>&1` the
previous test was effective.
  • Loading branch information
MaskRay committed Jul 20, 2024
1 parent d4dc8e4 commit 2d756d9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lld/test/MachO/reproduce-thin-archive-objc.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
## during linking. However, we need to iterate over all members for -ObjC, check that we don't
## crash when we encounter a missing member.

# RUN: rm -rf %t; mkdir %t
# RUN: sed s/SYM/_main/ %s | llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o
# RUN: sed s/SYM/_unused/ %s | llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/unused.o
# RUN: rm -rf %t && mkdir %t && cd %t
# RUN: sed s/SYM/_main/ %s | llvm-mc -filetype=obj -triple=x86_64-apple-macos -o main.o
# RUN: sed s/SYM/_unused/ %s | llvm-mc -filetype=obj -triple=x86_64-apple-macos -o unused.o

# RUN: cd %t; llvm-ar rcsT unused.a unused.o; rm unused.o
# RUN: llvm-ar rcsT unused.a unused.o; rm unused.o
## FIXME: Absolute paths don't end up relativized in the repro file.

# RUN: %no-fatal-warnings-lld %t/main.o %t/unused.a -ObjC -o /dev/null 2>&1 \
# RUN: | FileCheck %s --check-prefix=WARN

# RUN: %lld %t/main.o %t/unused.a -ObjC --no-warn-thin-archive-missing-members -o /dev/null \
# RUN: | FileCheck %s --implicit-check-not 'warning' --allow-empty
# RUN: %lld main.o unused.a -ObjC --no-warn-thin-archive-missing-members 2>&1 | count 0

# WARN: ld64.lld: warning: {{.*}}unused.a: -ObjC failed to open archive member: 'unused.o'
# WARN: warning: {{.*}}unused.a: -ObjC failed to open archive member: 'unused.o'

.text
.globl SYM
Expand Down

0 comments on commit 2d756d9

Please sign in to comment.