[llvm] [profcheck] Reorder the FileCheck substitution. (PR #176098)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 14 23:12:47 PST 2026


https://github.com/snehasish created https://github.com/llvm/llvm-project/pull/176098

In the profcheck build, FileCheck commands are substituted with cat > /dev/null to disable output verification. In a test/Transforms/SamplePrfile/remarks-hotness.ll we have both "FileCheck" and "not FileCheck" statements. Replacing the positive one first results in "not cat".
https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/SampleProfile/remarks-hotness.ll#L18

Run the not substitution first to fix this.

>From ff0a975184e49f969a7b36069d095591fe60ab83 Mon Sep 17 00:00:00 2001
From: Snehasish Kumar <snehasishk at google.com>
Date: Thu, 15 Jan 2026 07:08:52 +0000
Subject: [PATCH] [profcheck] Reorder the FileCheck substitution.

In the profcheck build, FileCheck commands are substituted with cat > /dev/null to disable output verification. In a test/Transforms/SamplePrfile/remarks-hotness.ll we have both "FileCheck" and "not FileCheck" statements. Replacing the positive one first results in "not cat".
https://github.com/llvm/llvm-project/blob/main/llvm/test/Transforms/SampleProfile/remarks-hotness.ll#L18

Run the not substitution first to fix this.
---
 llvm/test/lit.cfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index e711d82642fc2..fe12936495be7 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -31,8 +31,8 @@
 # testFormat: The test format to use to interpret tests.
 extra_substitutions = extra_substitutions = (
     [
-        (r"FileCheck .*", "cat > /dev/null"),
         (r"not FileCheck .*", "cat > /dev/null"),
+        (r"FileCheck .*", "cat > /dev/null"),
     ]
     if config.enable_profcheck
     else []



More information about the llvm-commits mailing list