[clang] [clang][OpenMP][NFC] Anchor "bar" CHECK-LABELs on the function definition (PR #232628)

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 00:05:58 PDT 2026


https://github.com/isanbard created https://github.com/llvm/llvm-project/pull/232628

ordered_doacross_codegen.cpp and parallel_for_simd_codegen.cpp use a bare "bar" as a CHECK-LABEL. That also matches the ModuleID and source_filename lines when the source path contains "bar" (e.g. a home directory like /home/isanbard), which splits the input at the wrong place and makes the tests fail. Match the define of @_Z3barv instead.

Assisted-by: Claude Opus 5.5

>From f671594455eb04c2448b99acafdf97f0107a6c70 Mon Sep 17 00:00:00 2001
From: Bill Wendling <isanbard at gmail.com>
Date: Fri, 16 Oct 2026 00:04:12 -0700
Subject: [PATCH] [clang][OpenMP][NFC] Anchor "bar" CHECK-LABELs on the
 function definition

ordered_doacross_codegen.cpp and parallel_for_simd_codegen.cpp use a
bare "bar" as a CHECK-LABEL. That also matches the ModuleID and
source_filename lines when the source path contains "bar" (e.g. a home
directory like /home/isanbard), which splits the input at the wrong
place and makes the tests fail. Match the define of @_Z3barv instead.

Assisted-by: Claude Opus 5.5
---
 clang/test/OpenMP/ordered_doacross_codegen.cpp  | 2 +-
 clang/test/OpenMP/parallel_for_simd_codegen.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/OpenMP/ordered_doacross_codegen.cpp b/clang/test/OpenMP/ordered_doacross_codegen.cpp
index cbb453bf871b6a..45c3b9e05186da 100644
--- a/clang/test/OpenMP/ordered_doacross_codegen.cpp
+++ b/clang/test/OpenMP/ordered_doacross_codegen.cpp
@@ -20,7 +20,7 @@ extern int n;
 int a[10], b[10], c[10], d[10];
 void foo();
 
-// CHECK-LABEL:bar
+// CHECK-LABEL: define {{.*}}void @_Z3barv()
 void bar() {
   int i,j;
 // CHECK: call void @__kmpc_doacross_init(
diff --git a/clang/test/OpenMP/parallel_for_simd_codegen.cpp b/clang/test/OpenMP/parallel_for_simd_codegen.cpp
index cc8cab706975ab..c9c5aaa6de299a 100644
--- a/clang/test/OpenMP/parallel_for_simd_codegen.cpp
+++ b/clang/test/OpenMP/parallel_for_simd_codegen.cpp
@@ -809,7 +809,7 @@ for (int i = 0; i < 10; ++i);
 // OMP50-DAG: ![[NOVECT]] = distinct !{![[NOVECT]], ![[NOVM:.+]]}
 // OMP50-DAG: ![[NOVM]] = !{!"llvm.loop.vectorize.disable"}
 
-// TERM_DEBUG-LABEL: bar
+// TERM_DEBUG-LABEL: define {{.*}}i32 @_Z3barv()
 int bar() { extern void mayThrow(); mayThrow(); return 0; };
 
 // TERM_DEBUG-LABEL: parallel_simd



More information about the cfe-commits mailing list