[lld-macho][nfc] Clean up tests

* Remove unnecessary `rm -rf %t`s
* Have lc-linker-option.ll use the right comment marker
This commit is contained in:
Jez Ng 2021-05-09 22:09:17 -04:00
parent 6215f49b8f
commit 3d5e5066f1
10 changed files with 33 additions and 43 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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