[lld] 2d756d9 - [lld-macho, test] Adjust reproduce-thin-archive-objc.s

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 20:12:19 PDT 2024


Author: Fangrui Song
Date: 2024-07-19T20:12:14-07:00
New Revision: 2d756d9d4c89ac50404f942f2db2f4a402aa0e00

URL: https://github.com/llvm/llvm-project/commit/2d756d9d4c89ac50404f942f2db2f4a402aa0e00
DIFF: https://github.com/llvm/llvm-project/commit/2d756d9d4c89ac50404f942f2db2f4a402aa0e00.diff

LOG: [lld-macho,test] Adjust reproduce-thin-archive-objc.s

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.

Added: 
    

Modified: 
    lld/test/MachO/reproduce-thin-archive-objc.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/reproduce-thin-archive-objc.s b/lld/test/MachO/reproduce-thin-archive-objc.s
index c5fe42f130526..8159f03f0f740 100644
--- a/lld/test/MachO/reproduce-thin-archive-objc.s
+++ b/lld/test/MachO/reproduce-thin-archive-objc.s
@@ -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


        


More information about the llvm-commits mailing list