From f2b4cc91e0830835c251e0525322effda8522b1c Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 2 Feb 2021 07:38:44 -0500 Subject: [PATCH] Revert "[test] Default clang/test to FileCheck --allow-unused-prefixes=false" This reverts commit 80f539526eec31f03aadd96753648686312b1ad1. Many test failures on mac: http://45.33.8.238/macm1/2772/summary.html One on win: http://45.33.8.238/win/32442/summary.html --- clang/test/Analysis/lit.local.cfg | 6 ++++++ clang/test/CodeGen/lit.local.cfg | 9 +++++++++ clang/test/CodeGenCXX/lit.local.cfg | 9 +++++++++ clang/test/Driver/lit.local.cfg | 26 ++++++++++++++++++++++++++ clang/test/OpenMP/lit.local.cfg | 10 ---------- clang/test/lit.cfg.py | 8 -------- 6 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 clang/test/CodeGen/lit.local.cfg create mode 100644 clang/test/CodeGenCXX/lit.local.cfg create mode 100644 clang/test/Driver/lit.local.cfg delete mode 100644 clang/test/OpenMP/lit.local.cfg diff --git a/clang/test/Analysis/lit.local.cfg b/clang/test/Analysis/lit.local.cfg index 1e8cf4c3b7c4..1560848b1f75 100644 --- a/clang/test/Analysis/lit.local.cfg +++ b/clang/test/Analysis/lit.local.cfg @@ -26,3 +26,9 @@ config.substitutions.append(('%normalize_sarif', if not config.root.clang_staticanalyzer: config.unsupported = True + +fc = ToolSubst('FileCheck', unresolved='fatal') +# Insert this first. Then, we'll first update the blank FileCheck command; then, +# the default substitution of FileCheck will replace it to its full path. +config.substitutions.insert(0, (fc.regex, + 'FileCheck --allow-unused-prefixes=false')) diff --git a/clang/test/CodeGen/lit.local.cfg b/clang/test/CodeGen/lit.local.cfg new file mode 100644 index 000000000000..c5bb8b60a52a --- /dev/null +++ b/clang/test/CodeGen/lit.local.cfg @@ -0,0 +1,9 @@ +# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79: +from lit.llvm.subst import ToolSubst + +fc = ToolSubst('FileCheck', unresolved='fatal') +# Insert this first. Then, we'll first update the blank FileCheck command; then, +# the default substitution of FileCheck will replace it to its full path. +config.substitutions.insert(0, (fc.regex, + 'FileCheck --allow-unused-prefixes=false')) + diff --git a/clang/test/CodeGenCXX/lit.local.cfg b/clang/test/CodeGenCXX/lit.local.cfg new file mode 100644 index 000000000000..c5bb8b60a52a --- /dev/null +++ b/clang/test/CodeGenCXX/lit.local.cfg @@ -0,0 +1,9 @@ +# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79: +from lit.llvm.subst import ToolSubst + +fc = ToolSubst('FileCheck', unresolved='fatal') +# Insert this first. Then, we'll first update the blank FileCheck command; then, +# the default substitution of FileCheck will replace it to its full path. +config.substitutions.insert(0, (fc.regex, + 'FileCheck --allow-unused-prefixes=false')) + diff --git a/clang/test/Driver/lit.local.cfg b/clang/test/Driver/lit.local.cfg new file mode 100644 index 000000000000..7dbadaeed12f --- /dev/null +++ b/clang/test/Driver/lit.local.cfg @@ -0,0 +1,26 @@ +from lit.llvm.subst import ToolSubst + +fc = ToolSubst('FileCheck', unresolved='fatal') +# Insert this first. Then, we'll first update the blank FileCheck command; then, +# the default substitution of FileCheck will replace it to its full path. +config.substitutions.insert(0, (fc.regex, + 'FileCheck --allow-unused-prefixes=false')) + +config.suffixes = ['.c', '.cpp', '.h', '.m', '.mm', '.S', '.s', '.f90', '.F90', '.f95', + '.cu', '.rs', '.cl', '.hip'] +config.substitutions = list(config.substitutions) +config.substitutions.insert(0, + ('%clang_cc1', + """*** Do not use 'clang -cc1' in Driver tests. ***""") ) + +# Remove harmful environmental variables for clang Driver tests. +# Some might be useful for other tests so they are only removed here. +driver_overwrite_env_vars = ['MACOSX_DEPLOYMENT_TARGET', + 'IPHONEOS_DEPLOYMENT_TARGET', + 'SDKROOT', 'CCC_OVERRIDE_OPTIONS', + 'CC_PRINT_OPTIONS', 'CC_PRINT_HEADERS', + 'CC_LOG_DIAGNOSTICS'] + +for name in driver_overwrite_env_vars: + if name in config.environment: + del config.environment[name] diff --git a/clang/test/OpenMP/lit.local.cfg b/clang/test/OpenMP/lit.local.cfg deleted file mode 100644 index ac72c2de9777..000000000000 --- a/clang/test/OpenMP/lit.local.cfg +++ /dev/null @@ -1,10 +0,0 @@ -# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79: -from lit.llvm.subst import ToolSubst - -fc = ToolSubst('FileCheck', unresolved='fatal') -# the parent introduced the opposite rule, so we replace it if we see it. -if len(config.substitutions) > 0 and config.substitutions[0] == (fc.regex, 'FileCheck --allow-unused-prefixes=false'): - config.substitutions[0] = ( - fc.regex, 'FileCheck --allow-unused-prefixes=true') -else: - config.substitutions.insert(0, (fc.regex, 'FileCheck --allow-unused-prefixes=true')) diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py index a47ebe74ddba..863ab444fb02 100644 --- a/clang/test/lit.cfg.py +++ b/clang/test/lit.cfg.py @@ -43,14 +43,6 @@ llvm_config.use_default_substitutions() llvm_config.use_clang() -# FIXME: remove this when we flip the default value for --allow-unused-prefixes -# to false. -fc = ToolSubst('FileCheck', unresolved='fatal') -# Insert this first. Then, we'll first update the blank FileCheck command; then, -# the default substitution of FileCheck will replace it to its full path. -config.substitutions.insert(0, (fc.regex, - 'FileCheck --allow-unused-prefixes=false')) - config.substitutions.append( ('%src_include_dir', config.clang_src_dir + '/include'))