jmorse created this revision.
jmorse added a reviewer: dongAxis1944.
Herald added subscribers: ChuanqiXu, lxfind.
jmorse requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Hi,

The test added in D97533 <https://reviews.llvm.org/D97533> (and modified by 
this patch) has some overly strict printed metadata ordering requirements, 
specifically the interleaving of DILocalVariable nodes and DILocation nodes. 
Unfortunately our downstream changes alter this order, which causes us trouble.

The patch below reduces the need for ordering: it picks out the DILocalVariable 
nodes being sought, in any order (CHECK-DAG), and doesn't examine any 
DILocations. The subsequent CHECK-NOTs are what's important: the test seeks to 
ensure a duplicate set of DILocalVariables aren't emitted in the same scope.

I've tested that this fails before 3a6a80b641bcf 
<https://reviews.llvm.org/rG3a6a80b641bcffc570d5bc187b45f7bb9a2e7ce2> and 
passes afterwards.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100298

Files:
  clang/test/CodeGenCoroutines/coro-dwarf.cpp


Index: clang/test/CodeGenCoroutines/coro-dwarf.cpp
===================================================================
--- clang/test/CodeGenCoroutines/coro-dwarf.cpp
+++ clang/test/CodeGenCoroutines/coro-dwarf.cpp
@@ -63,15 +63,9 @@
 }
 
 // CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "f_coro", linkageName: 
"_Z6f_coroi8MoveOnly11MoveAndCopy"
-// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "val", arg: 1, scope: ![[SP]], 
file: !8, line: 60, type: !{{[0-9]+}})
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 17, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "moParam", arg: 2, scope: 
![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 31, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", arg: 3, scope: 
![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 52, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 61, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 6, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocation(line: 0, scope: ![[SP]])
+// CHECK-DAG: !{{[0-9]+}} = !DILocalVariable(name: "val", arg: 1, scope: 
![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
+// CHECK-DAG: !{{[0-9]+}} = !DILocalVariable(name: "moParam", arg: 2, scope: 
![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
+// CHECK-DAG: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", arg: 3, scope: 
![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
 // CHECK-NOT: !{{[0-9]+}} = !DILocalVariable(name: "val", scope: ![[SP]], 
type: !{{[0-9]+}}, flags: DIFlagArtificial)
 // CHECK-NOT: !{{[0-9]+}} = !DILocalVariable(name: "moParam", scope: ![[SP]], 
type: !{{[0-9]+}}, flags: DIFlagArtificial)
 // CHECK-NOT:: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", scope: ![[SP]], 
type: !{{[0-9]+}}, flags: DIFlagArtificial)


Index: clang/test/CodeGenCoroutines/coro-dwarf.cpp
===================================================================
--- clang/test/CodeGenCoroutines/coro-dwarf.cpp
+++ clang/test/CodeGenCoroutines/coro-dwarf.cpp
@@ -63,15 +63,9 @@
 }
 
 // CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "f_coro", linkageName: "_Z6f_coroi8MoveOnly11MoveAndCopy"
-// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "val", arg: 1, scope: ![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 17, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "moParam", arg: 2, scope: ![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 31, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", arg: 3, scope: ![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 52, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 61, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocation(line: 60, column: 6, scope: ![[SP]])
-// CHECK: !{{[0-9]+}} = !DILocation(line: 0, scope: ![[SP]])
+// CHECK-DAG: !{{[0-9]+}} = !DILocalVariable(name: "val", arg: 1, scope: ![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
+// CHECK-DAG: !{{[0-9]+}} = !DILocalVariable(name: "moParam", arg: 2, scope: ![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
+// CHECK-DAG: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", arg: 3, scope: ![[SP]], file: !8, line: 60, type: !{{[0-9]+}})
 // CHECK-NOT: !{{[0-9]+}} = !DILocalVariable(name: "val", scope: ![[SP]], type: !{{[0-9]+}}, flags: DIFlagArtificial)
 // CHECK-NOT: !{{[0-9]+}} = !DILocalVariable(name: "moParam", scope: ![[SP]], type: !{{[0-9]+}}, flags: DIFlagArtificial)
 // CHECK-NOT:: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", scope: ![[SP]], type: !{{[0-9]+}}, flags: DIFlagArtificial)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to