[PATCH] D91275: [FileCheck] Disallow unused prefixes in llvm/test/Analysis

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 15:12:37 PST 2020


mtrofin updated this revision to Diff 304980.
mtrofin added a comment.

missing newline


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91275/new/

https://reviews.llvm.org/D91275

Files:
  llvm/test/Analysis/CostModel/X86/arith-fma.ll
  llvm/test/Analysis/CostModel/X86/arith-fp.ll
  llvm/test/Analysis/lit.local.cfg
  llvm/test/lit.cfg.py


Index: llvm/test/lit.cfg.py
===================================================================
--- llvm/test/lit.cfg.py
+++ llvm/test/lit.cfg.py
@@ -82,6 +82,10 @@
         return ''
     return found_dylibs[0]
 
+# Define this first. Afterwards, use_default_substitutions will add the rule for
+# expanding FileCheck to the full path.
+config.substitutions.append(('%FileCheckWithUnusedPrefixes%', 
+    'FileCheck --allow-unused-prefixes=true'))
 
 llvm_config.use_default_substitutions()
 
@@ -90,7 +94,6 @@
 config.substitutions.append(('%shlibext', config.llvm_shlib_ext))
 config.substitutions.append(('%exeext', config.llvm_exe_ext))
 
-
 lli_args = []
 # The target triple used by default by lli is the process target triple (some
 # triple appropriate for generating code for the current process) but because
Index: llvm/test/Analysis/lit.local.cfg
===================================================================
--- /dev/null
+++ llvm/test/Analysis/lit.local.cfg
@@ -0,0 +1,8 @@
+# -*- 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'))
Index: llvm/test/Analysis/CostModel/X86/arith-fp.ll
===================================================================
--- llvm/test/Analysis/CostModel/X86/arith-fp.ll
+++ llvm/test/Analysis/CostModel/X86/arith-fp.ll
@@ -4,8 +4,8 @@
 ; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE42
 ; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1
 ; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2
-; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F --allow-unused-prefixes
-; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW --allow-unused-prefixes
+; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f | %FileCheckWithUnusedPrefixes% %s --check-prefixes=CHECK,AVX512,AVX512F
+; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+avx512f,+avx512bw | %FileCheckWithUnusedPrefixes% %s --check-prefixes=CHECK,AVX512,AVX512BW
 ;
 ; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=slm | FileCheck %s --check-prefixes=CHECK,SLM
 ; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mcpu=goldmont | FileCheck %s --check-prefixes=CHECK,GLM
Index: llvm/test/Analysis/CostModel/X86/arith-fma.ll
===================================================================
--- llvm/test/Analysis/CostModel/X86/arith-fma.ll
+++ llvm/test/Analysis/CostModel/X86/arith-fma.ll
@@ -1,9 +1,9 @@
 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
 ; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+xop | FileCheck %s --check-prefixes=CHECK,XOP
-; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx | FileCheck %s --check-prefixes=CHECK,AVX,AVX1 --allow-unused-prefixes
-; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx2 | FileCheck %s --check-prefixes=CHECK,AVX,AVX2 --allow-unused-prefixes
-; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx512f | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512F --allow-unused-prefixes
-; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx512f,+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX512,AVX512BW --allow-unused-prefixes
+; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx | %FileCheckWithUnusedPrefixes% %s --check-prefixes=CHECK,AVX,AVX1
+; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx2 | %FileCheckWithUnusedPrefixes% %s --check-prefixes=CHECK,AVX,AVX2
+; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx512f | %FileCheckWithUnusedPrefixes% %s --check-prefixes=CHECK,AVX512,AVX512F
+; RUN: opt < %s -enable-no-nans-fp-math  -cost-model -analyze -mtriple=x86_64-apple-macosx10.8.0 -mattr=+fma,+avx512f,+avx512bw | %FileCheckWithUnusedPrefixes% %s --check-prefixes=CHECK,AVX512,AVX512BW
 
 ; CHECK: {{^}}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91275.304980.patch
Type: text/x-patch
Size: 5217 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201112/a72c1f98/attachment.bin>


More information about the llvm-commits mailing list