150
|
1 // RUN: llvm-tblgen %s | FileCheck %s
|
|
2 // XFAIL: vg_leak
|
|
3
|
|
4 // CHECK: --- Classes ---
|
|
5 // CHECK: list<int> ret = !foreach(a,
|
|
6
|
|
7 // CHECK: --- Defs ---
|
|
8
|
|
9 // CHECK: def C0 {
|
|
10 // CHECK: list<list<int>> ret = {{\[}}[1, 2, 3], [1, 2, 3]];
|
|
11 // CHECK: }
|
|
12
|
|
13 // The variable name 'a' is used both in the "inner" and in the "outer" foreach.
|
|
14 // The test ensure that the inner declaration of 'a' properly shadows the outer
|
|
15 // one.
|
|
16 class A<list<int> lst> {
|
|
17 list<int> ret = !foreach(a, lst, !add(a, 1));
|
|
18 }
|
|
19
|
|
20 class B<list<int> lst1, list<int> lst2> {
|
|
21 list<list<int>> ret = !foreach(a, lst1, A<lst2>.ret);
|
|
22 }
|
|
23
|
|
24 class C<list<int> lst2> {
|
|
25 list<list<int>> ret = B<[0, 1], lst2>.ret;
|
|
26 }
|
|
27
|
|
28 def C0 : C<[0, 1, 2]>;
|