[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-26 Thread Jeremy Morse via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3c9bcf0e3549: [Clang][Coroutine][DebugInfo] Relax test 
ordering requirement (authored by jmorse).

Changed prior to commit:
  https://reviews.llvm.org/D100298?vs=337793&id=340455#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100298/new/

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
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -std=c++2a -fcoroutines-ts -triple=x86_64 -dwarf-version=4 
-debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -disable-llvm-optzns -std=c++2a -fcoroutines-ts \
+// RUN:-triple=x86_64 -dwarf-version=4 -debug-info-kind=limited \
+// RUN:-emit-llvm -o - %s | \
+// RUN:FileCheck %s --implicit-check-not=DILocalVariable
 
 namespace std::experimental {
 template  struct coroutine_traits;
@@ -63,15 +66,7 @@
 }
 
 // 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-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)
+// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "val", arg: 1, scope: ![[SP]], 
file: !8, line: {{[0-9]+}}, type: !{{[0-9]+}})
+// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "moParam", arg: 2, scope: 
![[SP]], file: !8, line: {{[0-9]+}}, type: !{{[0-9]+}})
+// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", arg: 3, scope: 
![[SP]], file: !8, line: {{[0-9]+}}, type: !{{[0-9]+}})
+// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "__promise",


Index: clang/test/CodeGenCoroutines/coro-dwarf.cpp
===
--- clang/test/CodeGenCoroutines/coro-dwarf.cpp
+++ clang/test/CodeGenCoroutines/coro-dwarf.cpp
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -std=c++2a -fcoroutines-ts -triple=x86_64 -dwarf-version=4 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -disable-llvm-optzns -std=c++2a -fcoroutines-ts \
+// RUN:-triple=x86_64 -dwarf-version=4 -debug-info-kind=limited \
+// RUN:-emit-llvm -o - %s | \
+// RUN:FileCheck %s --implicit-check-not=DILocalVariable
 
 namespace std::experimental {
 template  struct coroutine_traits;
@@ -63,15 +66,7 @@
 }
 
 // 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-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)
+// 

[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-21 Thread Yifeng Dong via Phabricator via cfe-commits
dongAxis1944 accepted this revision.
dongAxis1944 added a comment.

LGTM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100298/new/

https://reviews.llvm.org/D100298

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-16 Thread Paul Robinson via Phabricator via cfe-commits
probinson accepted this revision.
probinson added a comment.
This revision is now accepted and ready to land.

One optional nit and LGTM, assuming the DILocalVariable ordering is consistent 
with what we see downstream.




Comment at: clang/test/CodeGenCoroutines/coro-dwarf.cpp:1
-// RUN: %clang_cc1 -std=c++2a -fcoroutines-ts -triple=x86_64 -dwarf-version=4 
-debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -disable-llvm-optzns -std=c++2a -fcoroutines-ts \
+// RUN:-triple=x86_64 -dwarf-version=4 -debug-info-kind=limited \

I prefer the spelling `-disable-llvm-passes` 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100298/new/

https://reviews.llvm.org/D100298

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-15 Thread Jeremy Morse via Phabricator via cfe-commits
jmorse updated this revision to Diff 337793.
jmorse added a comment.

Right you are -- another thing I didn't clock was that this test was running 
all of the LLVM passes (generating many instances of the coroutine function). 
Latest revision disables those passes so that there are only DILocalVariables 
for the un-coro-split function. I've confirmed this fails before the fix landed 
and passes afterwards.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100298/new/

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
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -std=c++2a -fcoroutines-ts -triple=x86_64 -dwarf-version=4 
-debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -disable-llvm-optzns -std=c++2a -fcoroutines-ts \
+// RUN:-triple=x86_64 -dwarf-version=4 -debug-info-kind=limited \
+// RUN:-emit-llvm -o - %s | \
+// RUN:FileCheck %s --implicit-check-not=DILocalVariable
 
 namespace std::experimental {
 template  struct coroutine_traits;
@@ -64,14 +67,6 @@
 
 // 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-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)
+// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "__promise",


Index: clang/test/CodeGenCoroutines/coro-dwarf.cpp
===
--- clang/test/CodeGenCoroutines/coro-dwarf.cpp
+++ clang/test/CodeGenCoroutines/coro-dwarf.cpp
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -std=c++2a -fcoroutines-ts -triple=x86_64 -dwarf-version=4 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -disable-llvm-optzns -std=c++2a -fcoroutines-ts \
+// RUN:-triple=x86_64 -dwarf-version=4 -debug-info-kind=limited \
+// RUN:-emit-llvm -o - %s | \
+// RUN:FileCheck %s --implicit-check-not=DILocalVariable
 
 namespace std::experimental {
 template  struct coroutine_traits;
@@ -64,14 +67,6 @@
 
 // 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-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)
+// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "__promise",
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-15 Thread Yifeng Dong via Phabricator via cfe-commits
dongAxis1944 added a comment.

@jmorse I am not familiar with CHECK-DAG. And @probinson 's suggestion might be 
useful, any ideas?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100298/new/

https://reviews.llvm.org/D100298

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-12 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment.

I am not 100% convinced this has the desired effect.  I believe what it does is:

- Search for the first occurrence of each of "val" "moParam" and "mcParam"
- After the last of the above occurrences, ensure there are no other 
occurrences of "val" "moParam" or "mcParam"

That is, it wouldn't fail on input of

  "val"
  "val"
  "moParam"
  "mcParam"

...because the second appearance of "val" is before the last text matched by 
one of the DAG directives.

I think really what you want is to specify the three variable names using 
{{--implicit-check-not}} on the FileCheck command, which (I am pretty sure) 
will apply to everything not explicitly matched by a CHECK directive.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100298/new/

https://reviews.llvm.org/D100298

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D100298: [Clang][Coroutine][DebugInfo] Follow-up: reduce a tests ordering requirements

2021-04-12 Thread Jeremy Morse via Phabricator via cfe-commits
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  (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 
 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
c