[lld] f04d1c3 - [lld-macho] Move all tests for erroneous inputs under invalid/
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 13:20:17 PDT 2020
Author: Jez Ng
Date: 2020-06-02T13:19:38-07:00
New Revision: f04d1c3b90c19f5c01b99f8fcd5794a6b338f124
URL: https://github.com/llvm/llvm-project/commit/f04d1c3b90c19f5c01b99f8fcd5794a6b338f124
DIFF: https://github.com/llvm/llvm-project/commit/f04d1c3b90c19f5c01b99f8fcd5794a6b338f124.diff
LOG: [lld-macho] Move all tests for erroneous inputs under invalid/
For consistency.
The no-id-dylib test was originally referencing the Inputs/ folder via a
relative path. Instead of updating that path, I decided to make the test
self-contained.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D80217
Added:
lld/test/MachO/invalid/alignment-too-large.yaml
lld/test/MachO/invalid/duplicate-symbol.s
lld/test/MachO/invalid/invalid-executable.s
lld/test/MachO/invalid/invalid-fat-narch.s
lld/test/MachO/invalid/invalid-fat-offset.s
lld/test/MachO/invalid/missing-dylib.s
lld/test/MachO/invalid/no-id-dylink.yaml
lld/test/MachO/invalid/no-such-file.s
Modified:
Removed:
lld/test/MachO/Inputs/no-id-dylib.yaml
lld/test/MachO/alignment-too-large.yaml
lld/test/MachO/duplicate-symbol.s
lld/test/MachO/invalid-executable.s
lld/test/MachO/invalid-fat-narch.s
lld/test/MachO/invalid-fat-offset.s
lld/test/MachO/missing-dylib.s
lld/test/MachO/no-id-dylink.s
lld/test/MachO/no-such-file.s
################################################################################
diff --git a/lld/test/MachO/alignment-too-large.yaml b/lld/test/MachO/invalid/alignment-too-large.yaml
similarity index 100%
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
similarity index 100%
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
similarity index 100%
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
similarity index 100%
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
similarity index 100%
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
similarity index 100%
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
similarity index 87%
rename from lld/test/MachO/Inputs/no-id-dylib.yaml
rename to lld/test/MachO/invalid/no-id-dylink.yaml
index 86657daf7f21..d5b0b33dcfeb 100644
--- 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 @@ LinkEditData:
- ' '
- _hello_world
- ''
-...
diff --git a/lld/test/MachO/no-such-file.s b/lld/test/MachO/invalid/no-such-file.s
similarity index 100%
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
index 7353b408b9b1..000000000000
--- 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
More information about the llvm-commits
mailing list