[lld] d6cfc29 - [lld/mac] Covert start-lib.s test to use qualified paths instead of `cd %t`
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 07:04:21 PST 2022
Author: Nico Weber
Date: 2022-11-27T10:00:30-05:00
New Revision: d6cfc293d20f5193dbcf70c7bd398c831abeaf6b
URL: https://github.com/llvm/llvm-project/commit/d6cfc293d20f5193dbcf70c7bd398c831abeaf6b
DIFF: https://github.com/llvm/llvm-project/commit/d6cfc293d20f5193dbcf70c7bd398c831abeaf6b.diff
LOG: [lld/mac] Covert start-lib.s test to use qualified paths instead of `cd %t`
Makes it easier to paste failing RUN lines to run them manually.
No behavior change.
Added:
Modified:
lld/test/MachO/start-lib.s
Removed:
################################################################################
diff --git a/lld/test/MachO/start-lib.s b/lld/test/MachO/start-lib.s
index aaf382413c6fc..2da940c929490 100644
--- a/lld/test/MachO/start-lib.s
+++ b/lld/test/MachO/start-lib.s
@@ -1,83 +1,86 @@
# REQUIRES: x86
-# RUN: rm -rf %t; split-file %s %t && cd %t
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin main.s -o main.o
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin calls-foo.s -o calls-foo.o
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin 1.s -o 1.o
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin 2.s -o 2.o
-# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin common.s -o common.o
+# RUN: rm -rf %t; split-file %s %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/calls-foo.s -o %t/calls-foo.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/1.s -o %t/1.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/2.s -o %t/2.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/common.s -o %t/common.o
-# RUN: llvm-as 1.ll -o 1.bc
-# RUN: llvm-as 2.ll -o 2.bc
+# RUN: echo "%t/1.o" > %t/filelist
+# RUN: echo "%t/2.o" >> %t/filelist
+
+# RUN: llvm-as %t/1.ll -o %t/1.bc
+# RUN: llvm-as %t/2.ll -o %t/2.bc
## Neither 1.o nor 2.o is loaded.
-# RUN: %lld main.o --start-lib 1.o 2.o --end-lib -why_load | count 0
-# RUN: %lld main.o --start-lib -filelist filelist --end-lib -why_load | count 0
-# RUN: llvm-readobj -s a.out | FileCheck %s
+# RUN: %lld %t/main.o -o %t/out --start-lib %t/1.o %t/2.o --end-lib -why_load | count 0
+# RUN: %lld %t/main.o -o %t/out --start-lib -filelist %t/filelist --end-lib -why_load | count 0
+# RUN: llvm-readobj -s %t/out | FileCheck %s
# CHECK-NOT: Name: _foo
# CHECK-NOT: Name: _bar
## _bar loads 2.o. The last --end-lib can be omitted.
-# RUN: %lld main.o -u _bar --start-lib 1.o 2.o -t -why_load | FileCheck %s --check-prefix=CHECK2WHY
-# RUN: %lld main.o -u _bar --start-lib -filelist filelist -t -why_load | FileCheck %s --check-prefix=CHECK2WHY
-# RUN: llvm-readobj -s a.out | FileCheck --check-prefix=CHECK2 %s
-# CHECK2WHY: main.o
-# CHECK2WHY-NEXT: 2.o
-# CHECK2WHY-NEXT: _bar forced load of 2.o
+# RUN: %lld %t/main.o -o %t/out -u _bar --start-lib %t/1.o %t/2.o -t -why_load | FileCheck %s --check-prefix=CHECK2WHY
+# RUN: %lld %t/main.o -o %t/out -u _bar --start-lib -filelist %t/filelist -t -why_load | FileCheck %s --check-prefix=CHECK2WHY
+# RUN: llvm-readobj -s %t/out | FileCheck --check-prefix=CHECK2 %s
+# CHECK2WHY: {{.*}}main.o
+# CHECK2WHY-NEXT: {{.*}}2.o
+# CHECK2WHY-NEXT: _bar forced load of {{.*}}2.o
# CHECK2WHY-EMPTY:
# CHECK2-NOT: Name: _foo
# CHECK2: Name: _bar
# CHECK2-NOT: Name: _foo
## _foo loads 1.o. 1.o loads 2.o.
-# RUN: %lld main.o -u _foo --start-lib 1.o 2.o -why_load | FileCheck %s --check-prefix=CHECK3WHY
-# RUN: llvm-readobj -s a.out | FileCheck --check-prefix=CHECK3 %s
-# RUN: %lld main.o -u _foo --start-lib 2.o --end-lib --start-lib 1.o -why_load | FileCheck %s --check-prefix=CHECK3WHY
-# RUN: llvm-readobj -s a.out | FileCheck --check-prefix=CHECK3 %s
-# CHECK3WHY: _foo forced load of 1.o
-# CHECK3WHY-NEXT: _bar forced load of 2.o
+# RUN: %lld %t/main.o -o %t/out -u _foo --start-lib %t/1.o %t/2.o -why_load | FileCheck %s --check-prefix=CHECK3WHY
+# RUN: llvm-readobj -s %t/out | FileCheck --check-prefix=CHECK3 %s
+# RUN: %lld %t/main.o -o %t/out -u _foo --start-lib %t/2.o --end-lib --start-lib %t/1.o -why_load | FileCheck %s --check-prefix=CHECK3WHY
+# RUN: llvm-readobj -s %t/out | FileCheck --check-prefix=CHECK3 %s
+# CHECK3WHY: _foo forced load of {{.*}}1.o
+# CHECK3WHY-NEXT: _bar forced load of {{.*}}2.o
# CHECK3WHY-EMPTY:
# CHECK3-DAG: Name: _foo
# CHECK3-DAG: Name: _bar
## Don't treat undefined _bar in 1.o as a lazy definition.
-# RUN: not %lld main.o -u _bar --start-lib 1.o 2>&1 | FileCheck %s --check-prefix=CHECK4
+# RUN: not %lld %t/main.o -u _bar --start-lib %t/1.o 2>&1 | FileCheck %s --check-prefix=CHECK4
# CHECK4: error: undefined symbol: _bar
-# RUN: %lld main.o -u _common --start-lib common.o
-# RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=COMMON1
+# RUN: %lld %t/main.o -o %t/out -u _common --start-lib %t/common.o
+# RUN: llvm-readobj -s %t/out | FileCheck %s --check-prefix=COMMON1
# COMMON1: Name: _common
-# RUN: %lld main.o --start-lib common.o
-# RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=COMMON2
+# RUN: %lld %t/main.o -o %t/out --start-lib %t/common.o
+# RUN: llvm-readobj -s %t/out | FileCheck %s --check-prefix=COMMON2
# COMMON2-NOT: Name: _common
## Neither 1.bc nor 2.bc is loaded.
-# RUN: %lld main.o --start-lib 1.bc 2.bc -why_load | count 0
-# RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=BITCODE
+# RUN: %lld %t/main.o -o %t/out --start-lib %t/1.bc %t/2.bc -why_load | count 0
+# RUN: llvm-readobj -s %t/out | FileCheck %s --check-prefix=BITCODE
# BITCODE-NOT: Name: _foo
# BITCODE-NOT: Name: _bar
## _bar loads 2.bc.
-# RUN: %lld main.o -u _bar --start-lib 1.bc 2.bc -why_load | FileCheck %s --check-prefix=BITCODE2WHY
-# RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=BITCODE2
-# BITCODE2WHY: _bar forced load of 2.bc
+# RUN: %lld %t/main.o -o %t/out -u _bar --start-lib %t/1.bc %t/2.bc -why_load | FileCheck %s --check-prefix=BITCODE2WHY
+# RUN: llvm-readobj -s %t/out | FileCheck %s --check-prefix=BITCODE2
+# BITCODE2WHY: _bar forced load of {{.*}}2.bc
# BITCODE2WHY-EMPTY:
# BITCODE2-NOT: Name: _foo
# BITCODE2: Name: _bar
# BITCODE2-NOT: Name: _foo
## calls-foo.o loads 1.bc. 1.bc loads 2.bc.
-# RUN: %lld calls-foo.o --start-lib 1.bc 2.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY
-# RUN: llvm-readobj -s a.out | FileCheck --check-prefix=BITCODE3 %s
-# RUN: %lld calls-foo.o --start-lib 2.bc --end-lib --start-lib 1.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY
-# RUN: llvm-readobj -s a.out | FileCheck --check-prefix=BITCODE3 %s
-# BITCODE3WHY: _foo forced load of 1.bc
-# BITCODE3WHY-NEXT: _bar forced load of 2.bc
+# RUN: %lld %t/calls-foo.o -o %t/out --start-lib %t/1.bc %t/2.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY
+# RUN: llvm-readobj -s %t/out | FileCheck --check-prefix=BITCODE3 %s
+# RUN: %lld %t/calls-foo.o -o %t/out --start-lib %t/2.bc --end-lib --start-lib %t/1.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY
+# RUN: llvm-readobj -s %t/out | FileCheck --check-prefix=BITCODE3 %s
+# BITCODE3WHY: _foo forced load of {{.*}}1.bc
+# BITCODE3WHY-NEXT: _bar forced load of {{.*}}2.bc
# BITCODE3WHY-EMPTY:
# BITCODE3-DAG: Name: _foo
-# RUN: not %lld main.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s
+# RUN: not %lld %t/main.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s
# NESTED-LIB: error: nested --start-lib
# RUN: not %lld --end-lib 2>&1 | FileCheck %s --check-prefix=STRAY
@@ -123,7 +126,3 @@ target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
define void @bar() {
ret void
}
-
-#--- filelist
-1.o
-2.o
More information about the llvm-commits
mailing list