[llvm-branch-commits] [lld] baef18d - [ELF] Reorganize "is only supported on" tests and fix some diagnostics

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 9 12:18:42 PST 2020


Author: Fangrui Song
Date: 2020-12-09T12:14:00-08:00
New Revision: baef18dffba1a2f91b47b484ac2233dfcf923f9b

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

LOG: [ELF] Reorganize "is only supported on" tests and fix some diagnostics

Added: 
    lld/test/ELF/target-specific-options.s

Modified: 
    lld/ELF/Driver.cpp

Removed: 
    lld/test/ELF/aarch64-cortex-a53-843419-cli.s
    lld/test/ELF/ppc64-tocopt-option.s


################################################################################
diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 2350a0e33638..4c183394ca89 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -317,10 +317,10 @@ static void checkOptions() {
     error("--fix-cortex-a8 is only supported on ARM targets");
 
   if (config->tocOptimize && config->emachine != EM_PPC64)
-    error("--toc-optimize is only supported on the PowerPC64 target");
+    error("--toc-optimize is only supported on PowerPC64 targets");
 
   if (config->pcRelOptimize && config->emachine != EM_PPC64)
-    error("--pcrel--optimize is only supported on the PowerPC64 target");
+    error("--pcrel-optimize is only supported on PowerPC64 targets");
 
   if (config->pie && config->shared)
     error("-shared and -pie may not be used together");

diff  --git a/lld/test/ELF/aarch64-cortex-a53-843419-cli.s b/lld/test/ELF/aarch64-cortex-a53-843419-cli.s
deleted file mode 100644
index b19f6c3cd251..000000000000
--- a/lld/test/ELF/aarch64-cortex-a53-843419-cli.s
+++ /dev/null
@@ -1,10 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-// RUN: not ld.lld %t -fix-cortex-a53-843419 -o /dev/null 2>&1 | FileCheck %s
-
-// CHECK: --fix-cortex-a53-843419 is only supported on AArch64 targets
-.globl entry
-.text
-        .quad 0
-entry:
-        ret

diff  --git a/lld/test/ELF/ppc64-tocopt-option.s b/lld/test/ELF/ppc64-tocopt-option.s
deleted file mode 100644
index 78494346beb5..000000000000
--- a/lld/test/ELF/ppc64-tocopt-option.s
+++ /dev/null
@@ -1,14 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: not ld.lld %t --toc-optimize -o /dev/null 2>&1 | FileCheck %s
-
-# CHECK: error: --toc-optimize is only supported on the PowerPC64 target
-
-         .global __start
-         .type __start, at function
-
-         .text
-        .quad 0
- __start:
-

diff  --git a/lld/test/ELF/target-specific-options.s b/lld/test/ELF/target-specific-options.s
new file mode 100644
index 000000000000..76227803f935
--- /dev/null
+++ b/lld/test/ELF/target-specific-options.s
@@ -0,0 +1,14 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
+
+# RUN: not ld.lld %t --fix-cortex-a53-843419 -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-843419
+# ERR-843419: error: --fix-cortex-a53-843419 is only supported on AArch64 targets
+
+# RUN: not ld.lld %t --pcrel-optimize -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-PCREL
+# ERR-PCREL: error: --pcrel-optimize is only supported on PowerPC64 targets
+
+# RUN: not ld.lld %t --toc-optimize -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR-TOC
+# ERR-TOC: error: --toc-optimize is only supported on PowerPC64 targets
+
+.globl _start
+_start:


        


More information about the llvm-branch-commits mailing list