[libcxx-commits] [libcxx] [libc++] Add a %{verify} substitution (PR #70878)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 31 17:25:41 PDT 2023


================
@@ -75,11 +75,14 @@ def parseScript(test, preamble):
     tmpDir, tmpBase = _getTempPaths(test)
     substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
 
-    # Check base substitutions and add the %{build} and %{run} convenience substitutions
+    # Check base substitutions and add the %{build}, %{verify} and %{run} convenience substitutions
+    #
+    # Note: We use -Wno-error with %{verify} to make sure that we don't treat all diagnostics as
+    #       errors, which doesn't make sense for clang-verify tests because we may want to check
+    #       for specific warning diagnostics.
     _checkBaseSubstitutions(substitutions)
-    substitutions.append(
-        ("%{build}", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe")
-    )
+    substitutions.append(("%{build}", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe"))
+    substitutions.append(("%{verify}", "%{cxx} %s %{flags} %{compile_flags} -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0"))
----------------
philnik777 wrote:

We could move the `-verify` to the end, so we could write `// RUN: %{verify}=something`.

https://github.com/llvm/llvm-project/pull/70878


More information about the libcxx-commits mailing list