[llvm-branch-commits] [lld] 3058526 - [mac/lld] Run tests with -fatal_warnings by default

Nico Weber via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 3 18:32:58 PST 2020


Author: Nico Weber
Date: 2020-12-03T21:23:47-05:00
New Revision: 305852686bf52037f81c0582400ceddb5e8844b3

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

LOG: [mac/lld] Run tests with -fatal_warnings by default

This helps us catch cases where we add support for a flag but forget to
remove HelpHidden from Options.td.

More explicit alternative to D92455

Differential Revision: https://reviews.llvm.org/D92575

Added: 
    

Modified: 
    lld/test/MachO/fatal-warnings.s
    lld/test/MachO/lit.local.cfg
    lld/test/MachO/load-commands.s
    lld/test/MachO/x86-64-reloc-unsigned.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/fatal-warnings.s b/lld/test/MachO/fatal-warnings.s
index 4ab5589cde08..ae08a1367868 100644
--- a/lld/test/MachO/fatal-warnings.s
+++ b/lld/test/MachO/fatal-warnings.s
@@ -1,10 +1,10 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t1.o
 
-# RUN: %lld %t1.o -o /dev/null -single_module 2>&1 \
+# RUN: %no_fatal_warnings_lld %t1.o -o /dev/null -single_module 2>&1 \
 # RUN:     | FileCheck -check-prefix=WARNING %s
-# RUN: not %lld %t1.o -fatal_warnings -o /dev/null -single_module 2>&1 \
-# RUN:     | FileCheck -check-prefix=ERROR %s
+# RUN: not %no_fatal_warnings_lld %t1.o -fatal_warnings -o /dev/null \
+# RUN:     -single_module 2>&1 | FileCheck -check-prefix=ERROR %s
 
 # ERROR: error: Option `-single_module' is deprecated
 # WARNING: warning: Option `-single_module' is deprecated

diff  --git a/lld/test/MachO/lit.local.cfg b/lld/test/MachO/lit.local.cfg
index 90ee9117cbad..64d28802068b 100644
--- a/lld/test/MachO/lit.local.cfg
+++ b/lld/test/MachO/lit.local.cfg
@@ -2,5 +2,7 @@
 
 import os
 
-config.substitutions.append(('%lld', 'lld -flavor darwinnew -syslibroot ' +
-  os.path.join(config.test_source_root, "MachO", "Inputs", "MacOSX.sdk")))
+lld = ('lld -flavor darwinnew -syslibroot ' +
+    os.path.join(config.test_source_root, "MachO", "Inputs", "MacOSX.sdk"))
+config.substitutions.append(('%lld', lld + ' -fatal_warnings'))
+config.substitutions.append(('%no_fatal_warnings_lld', lld))

diff  --git a/lld/test/MachO/load-commands.s b/lld/test/MachO/load-commands.s
index abeefc4043e1..0ee9edbb3d50 100644
--- a/lld/test/MachO/load-commands.s
+++ b/lld/test/MachO/load-commands.s
@@ -2,9 +2,9 @@
 # RUN: rm -rf %t && mkdir -p %t
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o
 # RUN: %lld -o %t/executable %t/test.o
-# RUN: %lld -fatal_warnings -execute -o %t/explicit-executable %t/test.o
-# RUN: %lld -fatal_warnings -bundle -o %t/bundle %t/test.o
-# RUN: %lld -fatal_warnings -dylib -o %t/dylib %t/test.o
+# RUN: %lld -execute -o %t/explicit-executable %t/test.o
+# RUN: %lld -bundle -o %t/bundle %t/test.o
+# RUN: %lld -dylib -o %t/dylib %t/test.o
 
 ## These load commands should be in every final output binary.
 # COMMON-DAG: cmd LC_DYLD_INFO_ONLY

diff  --git a/lld/test/MachO/x86-64-reloc-unsigned.s b/lld/test/MachO/x86-64-reloc-unsigned.s
index c6e5eb665739..f1afc0cb7043 100644
--- a/lld/test/MachO/x86-64-reloc-unsigned.s
+++ b/lld/test/MachO/x86-64-reloc-unsigned.s
@@ -3,11 +3,11 @@
 # RUN: %lld -o %t %t.o
 # RUN: llvm-objdump --macho --rebase --full-contents %t | FileCheck %s
 
-# RUN: %lld -fatal_warnings -pie -o %t-pie %t.o
+# RUN: %lld -pie -o %t-pie %t.o
 # RUN: llvm-objdump --macho --rebase %t-pie | FileCheck %s --check-prefix=PIE
-# RUN: %lld -fatal_warnings -pie -no_pie -o %t-no-pie %t.o
+# RUN: %lld -pie -no_pie -o %t-no-pie %t.o
 # RUN: llvm-objdump --macho --rebase %t-no-pie | FileCheck %s --check-prefix=NO-PIE
-# RUN: %lld -fatal_warnings -no_pie -pie -o %t-no-pie %t.o
+# RUN: %lld -no_pie -pie -o %t-no-pie %t.o
 # RUN: llvm-objdump --macho --rebase %t-no-pie | FileCheck %s --check-prefix=NO-PIE
 
 # RUN: %lld -platform_version macos 10.6.0 11.0 -o %t-pie %t.o


        


More information about the llvm-branch-commits mailing list