[clang] 9e33cb2 - Fix `pragma-comment.c` test failing on false match (#145455)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 11:11:24 PDT 2025


Author: Dave Bartolomeo
Date: 2025-06-24T14:11:20-04:00
New Revision: 9e33cb22f991fb25d606d89c0e5a13a3ebed52fe

URL: https://github.com/llvm/llvm-project/commit/9e33cb22f991fb25d606d89c0e5a13a3ebed52fe
DIFF: https://github.com/llvm/llvm-project/commit/9e33cb22f991fb25d606d89c0e5a13a3ebed52fe.diff

LOG: Fix `pragma-comment.c` test failing on false match (#145455)

Sometimes the forbidden text `foo` or `bar` could appear in the Clang
version string metadata. Treating the version string as a `CHECK-LABEL:`
prevents this.

Fixes #145453

Added: 
    

Modified: 
    clang/test/CodeGen/pragma-comment.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/pragma-comment.c b/clang/test/CodeGen/pragma-comment.c
index a966840f7c26f..861fba9aece3b 100644
--- a/clang/test/CodeGen/pragma-comment.c
+++ b/clang/test/CodeGen/pragma-comment.c
@@ -32,3 +32,6 @@
 // ELF: ![[space]] = !{!"with space"}
 // ELF-NOT: bar
 // ELF-NOT: foo
+// This following match prevents the clang version metadata from matching the forbidden 'foo' and 'bar' tokens.
+// This can happen if the clang version string contains a Git repo URL that includes one of those substrings.
+// ELF-LABEL: !"clang version


        


More information about the cfe-commits mailing list