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// CHECK: Jr
11// CHECK: Sr
12
13// Variables for foreach
14class decls {
15  string name;
16}
17
18def Decls : decls;
19
20class A<list<string> names> {
21  list<string> Names = names;
22}
23
24class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>;
25
26class C<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Jr."))>;
27
28class D<list<string> names> : A<!foreach(Decls.name, names, !subst("NAME", "John Smith", Decls.name))>;
29
30class Names {
31  list<string> values = ["Ken Griffey", "Seymour Cray"];
32}
33
34def People : Names;
35
36def Seniors : B<People.values>;
37def Juniors : C<People.values>;
38def Smiths : D<["NAME", "Jane Smith"]>;
39def Unprocessed : D<People.values>;
40