[clang] [DebugInfo] Make a test more robust (PR #106463)

Paul T Robinson via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 15:42:11 PDT 2024


https://github.com/pogo59 created https://github.com/llvm/llvm-project/pull/106463

This was accidentally matching a metadata record that happend to have three elements, but wasn't the record of interest. Add CHECKs to make sure we've found the correct record.

>From 845fb7105d0e23df57ced47c1f19d464450095af Mon Sep 17 00:00:00 2001
From: Paul Robinson <paul.robinson at sony.com>
Date: Wed, 28 Aug 2024 15:39:30 -0700
Subject: [PATCH] [DebugInfo] Make a test more robust

This was accidentally matching a metadata record that happend to have
three elements, but wasn't the record of interest. Add CHECKs to make
sure we've found the correct record.
---
 clang/test/CodeGenCXX/debug-info-lambda-this.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/test/CodeGenCXX/debug-info-lambda-this.cpp b/clang/test/CodeGenCXX/debug-info-lambda-this.cpp
index 0a2f08ea4aa6d8..e5acab126d72ca 100644
--- a/clang/test/CodeGenCXX/debug-info-lambda-this.cpp
+++ b/clang/test/CodeGenCXX/debug-info-lambda-this.cpp
@@ -21,7 +21,8 @@ int main() {
   return 0;
 }
 
-// CHECK: !{![[FOO_THIS:[0-9]+]], ![[FOO_AA:[0-9]+]], ![[FOO_OPERATOR:[0-9]+]]}
+// CHECK: distinct !DICompositeType(tag: DW_TAG_class_type, name: "<lambda_1>", {{.*}}, elements: ![[ELEMENT_TAG:[0-9]+]]
+// CHECK: ![[ELEMENT_TAG]] = !{![[FOO_THIS:[0-9]+]], ![[FOO_AA:[0-9]+]], ![[FOO_OPERATOR:[0-9]+]]}
 // CHECK-NEXT: ![[FOO_THIS]] = !DIDerivedType(tag: DW_TAG_member, name: "__this", scope: ![[#]], file: ![[#]], line: [[#]], baseType: ![[#]], size: [[#]])
 // CHECK-NEXT: ![[FOO_AA]] = !DIDerivedType(tag: DW_TAG_member, name: "aa", scope: ![[#]], file: ![[#]], line: [[#]], baseType: ![[#]], size: [[#]], offset: [[#]])
 // CHECK-NEXT: ![[FOO_OPERATOR]] = !DISubprogram(name: "operator()", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], scopeLine: [[#]], flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)



More information about the cfe-commits mailing list