1// RUN: llvm-tblgen %s | FileCheck %s
2// XFAIL: vg_leak
3
4// CHECK: Classes
5// CHECK: Sr
6// CHECK: Jr
7// CHECK: "NAME"
8
9// CHECK: Defs
10
11// CHECK: def DX {
12// CHECK:   list<string> x = ["0", "1", "2"];
13// CHECK: }
14
15// CHECK: def DY {
16// CHECK:   list<int> y = [5, 7];
17// CHECK: }
18
19// CHECK: Jr
20// CHECK: Sr
21
22class A<list<string> names> {
23  list<string> Names = names;
24}
25
26class B<list<string> names> : A<!foreach(name, names, !strconcat(name, ", Sr."))>;
27
28class C<list<string> names> : A<!foreach(name, names, !strconcat(name, ", Jr."))>;
29
30class D<list<string> names> : A<!foreach(name, names, !subst("NAME", "John Smith", name))>;
31
32class Names {
33  list<string> values = ["Ken Griffey", "Seymour Cray"];
34}
35
36def People : Names;
37
38def Seniors : B<People.values>;
39def Juniors : C<People.values>;
40def Smiths : D<["NAME", "Jane Smith"]>;
41def Unprocessed : D<People.values>;
42
43class X<list<int> a> {
44    list<string> x = !foreach(num, a, !cast<string>(num));
45}
46
47def DX : X<[0, 1, 2]>;
48
49class Y<list<int> a> {
50  list<int> y = !foreach(num, a, !add(!add(4, num), !add(1, num)));
51}
52
53def DY: Y<[0, 1]>;
54