From 7283ec017049862423934187e35d69123774bbdc Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 8 May 2020 14:43:16 +0200 Subject: [PATCH] [lldb] Fix RecordDecl match string in module-ownership.mm to get the test running again The relevant output FileCheck is scanning in this test is as follows: CXXRecordDecl 0x7f96cf8239c8 <> imported in A.B struct definition <> `-FieldDecl 0x7f96cf823b90 <> imported in A.B anon_field_b 'int' (anonymous struct) CXXRecordDecl 0x7f96cf823be8 <> imported in A.B struct Before 710fa2c4ee346e1ec2db66ac5fdf6909e79d9a8c this test was passing by accident as it had a -DAG suffix in the checks changed by this patch, causing FileCheck to first match the last line of the output above (instead of the first one), and then finding the FieldDecl above. When I removed the -DAG suffix, FileCheck actually enforced the ordering and started failing as the FieldDecl comes before the CXXRecordDecl match we get. This patch fixes the CXXRecordDecl check to find the first line of the output above which caused FileCheck to also find the FieldDecl that follows. Also gives the FieldDecl a more unique name to make name collisions less likely. --- lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/B.h | 2 +- lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/B.h b/lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/B.h index 23d8347a2322..384d59b7b80a 100644 --- a/lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/B.h +++ b/lldb/test/Shell/SymbolFile/DWARF/Inputs/ModuleOwnership/B.h @@ -1,5 +1,5 @@ typedef struct { - int b; + int anon_field_b; } StructB; namespace Namespace { diff --git a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm index 36bd1bfe37e6..b20e08024b9b 100644 --- a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm +++ b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm @@ -25,8 +25,8 @@ Struct s2; // CHECK-ANON-S1: CXXRecordDecl {{.*}} imported in A struct StructB s3; -// CHECK-ANON-S2: CXXRecordDecl {{.*}} imported in A.B struct -// CHECK-ANON-S2: -FieldDecl {{.*}} in A.B b 'int' +// CHECK-ANON-S2: CXXRecordDecl {{.*}} imported in A.B {{.*}} struct +// CHECK-ANON-S2: -FieldDecl {{.*}} in A.B anon_field_b 'int' Nested s4; // CHECK-DAG: CXXRecordDecl {{.*}} imported in A struct Nested