annotate gcc/testsuite/g++.dg/debug/dwarf2/lambda1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR c++/43912
kono
parents:
diff changeset
2 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
3 // { dg-options "-gdwarf-2 -dA -fno-merge-debug-strings -gno-strict-dwarf" }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 // Check for the local alias variables that point to the members of the closure.
kono
parents:
diff changeset
6 // { dg-final { scan-assembler-times "DW_TAG_variable\[^.\]*\.ascii \"j.0\"" 4 { xfail { powerpc-ibm-aix* } } } }
kono
parents:
diff changeset
7 // { dg-final { scan-assembler-times "DW_TAG_variable\[^.\]*\.ascii \"this.0\"" 2 { xfail { powerpc-ibm-aix* } } } }
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 struct A
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 int i;
kono
parents:
diff changeset
12 int f()
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 int j;
kono
parents:
diff changeset
15 [&]() { j = i; }();
kono
parents:
diff changeset
16 return j;
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18 };
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 template <class T>
kono
parents:
diff changeset
21 struct B
kono
parents:
diff changeset
22 {
kono
parents:
diff changeset
23 int i;
kono
parents:
diff changeset
24 int f()
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 int j;
kono
parents:
diff changeset
27 [&]() { j = i; }();
kono
parents:
diff changeset
28 return j;
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30 };
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 int main()
kono
parents:
diff changeset
33 {
kono
parents:
diff changeset
34 A().f();
kono
parents:
diff changeset
35 B<int>().f();
kono
parents:
diff changeset
36 }