diff --git a/lld/test/MachO/alignment-too-large.yaml b/lld/test/MachO/invalid/alignment-too-large.yaml rename from lld/test/MachO/alignment-too-large.yaml rename to lld/test/MachO/invalid/alignment-too-large.yaml diff --git a/lld/test/MachO/duplicate-symbol.s b/lld/test/MachO/invalid/duplicate-symbol.s rename from lld/test/MachO/duplicate-symbol.s rename to lld/test/MachO/invalid/duplicate-symbol.s diff --git a/lld/test/MachO/invalid-executable.s b/lld/test/MachO/invalid/invalid-executable.s rename from lld/test/MachO/invalid-executable.s rename to lld/test/MachO/invalid/invalid-executable.s diff --git a/lld/test/MachO/invalid-fat-narch.s b/lld/test/MachO/invalid/invalid-fat-narch.s rename from lld/test/MachO/invalid-fat-narch.s rename to lld/test/MachO/invalid/invalid-fat-narch.s diff --git a/lld/test/MachO/invalid-fat-offset.s b/lld/test/MachO/invalid/invalid-fat-offset.s rename from lld/test/MachO/invalid-fat-offset.s rename to lld/test/MachO/invalid/invalid-fat-offset.s diff --git a/lld/test/MachO/missing-dylib.s b/lld/test/MachO/invalid/missing-dylib.s rename from lld/test/MachO/missing-dylib.s rename to lld/test/MachO/invalid/missing-dylib.s diff --git a/lld/test/MachO/Inputs/no-id-dylib.yaml b/lld/test/MachO/invalid/no-id-dylink.yaml rename from lld/test/MachO/Inputs/no-id-dylib.yaml rename to lld/test/MachO/invalid/no-id-dylink.yaml --- a/lld/test/MachO/Inputs/no-id-dylib.yaml +++ b/lld/test/MachO/invalid/no-id-dylink.yaml @@ -1,5 +1,12 @@ -## This yaml file was originally generated from linking the following source -## input with ld64: +# REQUIRES: x86 +# RUN: mkdir -p %t +# RUN: yaml2obj %s -o %t/libnoid.dylib +# RUN: echo ".globl _main; .text; _main: ret" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/no-id-dylink.o +# RUN: not lld -flavor darwinnew -o %t/no-id-dylink -Z -L%t -lnoid %t/no-id-dylink.o 2>&1 | FileCheck %s +# CHECK: error: dylib {{.*}}libnoid.dylib missing LC_ID_DYLIB load command + +## This YAML file was originally generated from linking the following source +## input with ld64 and passing the resulting binary through obj2yaml: ## ## .section __TEXT,__cstring ## .globl _hello_world @@ -7,9 +14,9 @@ ## _hello_world: ## .asciz "Hello world!\n" ## -## Then we deleted the LC_ID_DYLIB command from the YAML file. +## Then we deleted the LC_ID_DYLIB command from the file. ---- !mach-o +!mach-o FileHeader: magic: 0xFEEDFACF cputype: 0x01000007 @@ -157,4 +164,3 @@ - ' ' - _hello_world - '' -... diff --git a/lld/test/MachO/no-such-file.s b/lld/test/MachO/invalid/no-such-file.s rename from lld/test/MachO/no-such-file.s rename to lld/test/MachO/invalid/no-such-file.s diff --git a/lld/test/MachO/no-id-dylink.s b/lld/test/MachO/no-id-dylink.s deleted file mode 100644 --- a/lld/test/MachO/no-id-dylink.s +++ /dev/null @@ -1,13 +0,0 @@ -# REQUIRES: x86 -# RUN: mkdir -p %t -# RUN: yaml2obj %p/Inputs/no-id-dylib.yaml -o %t/libnoid.dylib -# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/no-id-dylink.o -# RUN: not lld -flavor darwinnew -o %t/no-id-dylink -Z -L%t -lnoid %t/no-id-dylink.o 2>&1 | FileCheck %s -# CHECK: error: dylib {{.*}}libnoid.dylib missing LC_ID_DYLIB load command - -.text -.globl _main - -_main: - mov $0, %rax - ret