[lld] 3d5e506 - [lld-macho][nfc] Clean up tests

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 12:46:35 PDT 2021


Author: Jez Ng
Date: 2021-05-10T15:45:54-04:00
New Revision: 3d5e5066f1af50ea622d136e9543aedae178c8e5

URL: https://github.com/llvm/llvm-project/commit/3d5e5066f1af50ea622d136e9543aedae178c8e5
DIFF: https://github.com/llvm/llvm-project/commit/3d5e5066f1af50ea622d136e9543aedae178c8e5.diff

LOG: [lld-macho][nfc] Clean up tests

* Remove unnecessary `rm -rf %t`s
* Have lc-linker-option.ll use the right comment marker

Added: 
    

Modified: 
    lld/test/MachO/U-dynamic-lookup.s
    lld/test/MachO/adhoc-codesign.s
    lld/test/MachO/dependency-info.s
    lld/test/MachO/flat-namespace.s
    lld/test/MachO/invalid/undefined-symbol.s
    lld/test/MachO/lc-linker-option.ll
    lld/test/MachO/sub-library.s
    lld/test/MachO/t.s
    lld/test/MachO/u.s
    lld/test/MachO/why-load.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/U-dynamic-lookup.s b/lld/test/MachO/U-dynamic-lookup.s
index 2f867f87fe842..b0b4f7734a3e3 100644
--- a/lld/test/MachO/U-dynamic-lookup.s
+++ b/lld/test/MachO/U-dynamic-lookup.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s

diff  --git a/lld/test/MachO/adhoc-codesign.s b/lld/test/MachO/adhoc-codesign.s
index d9817b77a5308..1795035cc17eb 100644
--- a/lld/test/MachO/adhoc-codesign.s
+++ b/lld/test/MachO/adhoc-codesign.s
@@ -1,6 +1,5 @@
 # REQUIRES: x86, aarch64
 
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos -o %t/main-arm64-macos.o %t/main.s

diff  --git a/lld/test/MachO/dependency-info.s b/lld/test/MachO/dependency-info.s
index fe7c33ace8f4c..57b0b88ca8fe6 100644
--- a/lld/test/MachO/dependency-info.s
+++ b/lld/test/MachO/dependency-info.s
@@ -1,6 +1,4 @@
 # REQUIRES: x86
-#
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s

diff  --git a/lld/test/MachO/flat-namespace.s b/lld/test/MachO/flat-namespace.s
index 79d575c480dd3..dea8536a3fe1a 100644
--- a/lld/test/MachO/flat-namespace.s
+++ b/lld/test/MachO/flat-namespace.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s

diff  --git a/lld/test/MachO/invalid/undefined-symbol.s b/lld/test/MachO/invalid/undefined-symbol.s
index dd6fa1728e048..b2f5eee700fdd 100644
--- a/lld/test/MachO/invalid/undefined-symbol.s
+++ b/lld/test/MachO/invalid/undefined-symbol.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# RUN: rm -rf %t
 # 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/foo.s -o %t/foo.o

diff  --git a/lld/test/MachO/lc-linker-option.ll b/lld/test/MachO/lc-linker-option.ll
index fae023bd70c9e..5906f90a8df85 100644
--- a/lld/test/MachO/lc-linker-option.ll
+++ b/lld/test/MachO/lc-linker-option.ll
@@ -1,33 +1,32 @@
-# REQUIRES: x86
-# RUN: rm -rf %t
-# RUN: rm -rf %t; split-file %s %t
-
-# RUN: llvm-as %t/framework.ll -o %t/framework.o
-# RUN: %lld %t/framework.o -o %t/frame
-# RUN: llvm-objdump --macho --all-headers %t/frame | FileCheck --check-prefix=FRAME %s \
-# RUN:  --implicit-check-not LC_LOAD_DYLIB
-# FRAME:          cmd LC_LOAD_DYLIB
-# FRAME-NEXT: cmdsize
-# FRAME-NEXT:    name /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
-
-# RUN: llvm-as %t/l.ll -o %t/l.o
-# RUN: %lld %t/l.o -o %t/l
-# RUN: llvm-objdump --macho --all-headers %t/l | FileCheck --check-prefix=LIB %s \
-# RUN:  --implicit-check-not LC_LOAD_DYLIB
-
-## Check that we don't create duplicate LC_LOAD_DYLIBs.
-# RUN: %lld -lSystem %t/l.o -o %t/l
-# RUN: llvm-objdump --macho --all-headers %t/l | FileCheck --check-prefix=LIB %s \
-# RUN:  --implicit-check-not LC_LOAD_DYLIB
-# LIB:          cmd LC_LOAD_DYLIB
-# LIB-NEXT: cmdsize
-# LIB-NEXT:    name /usr/lib/libSystem.dylib
-
-# RUN: llvm-as %t/invalid.ll -o %t/invalid.o
-# RUN: not %lld %t/invalid.o -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s
-# INVALID: error: -why_load is not allowed in LC_LINKER_OPTION
-
-#--- framework.ll
+; REQUIRES: x86
+; RUN: rm -rf %t; split-file %s %t
+;
+; RUN: llvm-as %t/framework.ll -o %t/framework.o
+; RUN: %lld %t/framework.o -o %t/frame
+; RUN: llvm-objdump --macho --all-headers %t/frame | FileCheck --check-prefix=FRAME %s \
+; RUN:  --implicit-check-not LC_LOAD_DYLIB
+; FRAME:          cmd LC_LOAD_DYLIB
+; FRAME-NEXT: cmdsize
+; FRAME-NEXT:    name /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
+;
+; RUN: llvm-as %t/l.ll -o %t/l.o
+; RUN: %lld %t/l.o -o %t/l
+; RUN: llvm-objdump --macho --all-headers %t/l | FileCheck --check-prefix=LIB %s \
+; RUN:  --implicit-check-not LC_LOAD_DYLIB
+;
+;; Check that we don't create duplicate LC_LOAD_DYLIBs.
+; RUN: %lld -lSystem %t/l.o -o %t/l
+; RUN: llvm-objdump --macho --all-headers %t/l | FileCheck --check-prefix=LIB %s \
+; RUN:  --implicit-check-not LC_LOAD_DYLIB
+; LIB:          cmd LC_LOAD_DYLIB
+; LIB-NEXT: cmdsize
+; LIB-NEXT:    name /usr/lib/libSystem.dylib
+;
+; RUN: llvm-as %t/invalid.ll -o %t/invalid.o
+; RUN: not %lld %t/invalid.o -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s
+; INVALID: error: -why_load is not allowed in LC_LINKER_OPTION
+;
+;--- framework.ll
 target triple = "x86_64-apple-macosx10.15.0"
 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 
@@ -38,7 +37,7 @@ define void @main() {
   ret void
 }
 
-#--- l.ll
+;--- l.ll
 target triple = "x86_64-apple-macosx10.15.0"
 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 
@@ -49,7 +48,7 @@ define void @main() {
   ret void
 }
 
-#--- invalid.ll
+;--- invalid.ll
 
 target triple = "x86_64-apple-macosx10.15.0"
 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

diff  --git a/lld/test/MachO/sub-library.s b/lld/test/MachO/sub-library.s
index 7f5e2904e9621..322ce90bb216a 100644
--- a/lld/test/MachO/sub-library.s
+++ b/lld/test/MachO/sub-library.s
@@ -1,5 +1,5 @@
 # REQUIRES: x86
-# RUN: mkdir -p %t
+# RUN: rm -rf %t; mkdir -p %t
 
 ## Create a libsuper that has libgoodbye as a sub-library, which in turn has
 ## libhello as another sub-library.

diff  --git a/lld/test/MachO/t.s b/lld/test/MachO/t.s
index c8fe0b2de3452..8626950448dc3 100644
--- a/lld/test/MachO/t.s
+++ b/lld/test/MachO/t.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s

diff  --git a/lld/test/MachO/u.s b/lld/test/MachO/u.s
index ff6c6d71303b7..fb5159aa6a07e 100644
--- a/lld/test/MachO/u.s
+++ b/lld/test/MachO/u.s
@@ -1,9 +1,8 @@
 # REQUIRES: x86
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
-# RUN: llvm-ar csr  %t/lib.a %t/foo.o
+# RUN: llvm-ar csr %t/lib.a %t/foo.o
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
 

diff  --git a/lld/test/MachO/why-load.s b/lld/test/MachO/why-load.s
index 136187bf8f333..4ad3d4600ac9e 100644
--- a/lld/test/MachO/why-load.s
+++ b/lld/test/MachO/why-load.s
@@ -1,5 +1,4 @@
 # REQUIRES: x86
-# RUN: rm -rf %t
 # RUN: rm -rf %t; split-file %s %t
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/objc.o %t/objc.s


        


More information about the llvm-commits mailing list