[Lldb-commits] [lldb] 710fa2c - [lldb] Make module-ownership.mm test more robust against AST node ordering

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri May 8 04:44:34 PDT 2020


Author: Raphael Isemann
Date: 2020-05-08T13:44:13+02:00
New Revision: 710fa2c4ee346e1ec2db66ac5fdf6909e79d9a8c

URL: https://github.com/llvm/llvm-project/commit/710fa2c4ee346e1ec2db66ac5fdf6909e79d9a8c
DIFF: https://github.com/llvm/llvm-project/commit/710fa2c4ee346e1ec2db66ac5fdf6909e79d9a8c.diff

LOG: [lldb] Make module-ownership.mm test more robust against AST node ordering

The current test is checking both the anonymous structs and the template
specializations in one FileCheck run, but the anonymous struct line can
partially match the AST dump of a template specialization, causing that
FileCheck won't match that same line later against the template specialization
check and incorrectly fails on that check. This only happens when the
template specialization node somehow ends up before the anonymous struct node.

This patch just puts the checks for the anonymous structs in their own FileCheck
run to prevent them from partially matching any other record decl.

Fixes rdar://62997926

Added: 
    

Modified: 
    lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm

Removed: 
    


################################################################################
diff  --git a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
index f675c3aa8204..72f2c8865f97 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
+++ b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
@@ -1,6 +1,8 @@
 // RUN: %clang --target=x86_64-apple-macosx -g -gmodules \
 // RUN:    -fmodules -fmodules-cache-path=%t.cache \
 // RUN:    -c -o %t.o %s -I%S/Inputs
+// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck --check-prefix CHECK-ANON-S1 %s
+// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck --check-prefix CHECK-ANON-S2 %s
 // RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck %s
 // Verify that the owning module information from DWARF is preserved in the AST.
 
@@ -20,11 +22,11 @@
 // CHECK-TOPLEVELSTRUCT: -FieldDecl {{.*}} in A a 'int'
 
 Struct s2;
-// CHECK-DAG: CXXRecordDecl {{.*}} imported in A struct
+// CHECK-ANON-S1: CXXRecordDecl {{.*}} imported in A struct
 
 StructB s3;
-// CHECK-DAG: CXXRecordDecl {{.*}} imported in A.B struct
-// CHECK-DAG: -FieldDecl {{.*}} in A.B b 'int'
+// CHECK-ANON-S2: CXXRecordDecl {{.*}} imported in A.B struct
+// CHECK-ANON-S2: -FieldDecl {{.*}} in A.B b 'int'
 
 Nested s4;
 // CHECK-DAG: CXXRecordDecl {{.*}} imported in A struct Nested


        


More information about the lldb-commits mailing list