• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-tblgen %s | grep {Jr} | count 2
2// RUN: llvm-tblgen %s | grep {Sr} | count 2
3// RUN: llvm-tblgen %s | grep {NAME} | count 1
4// XFAIL: vg_leak
5
6// Variables for foreach
7class decls {
8  string name;
9}
10
11def Decls : decls;
12
13class A<list<string> names> {
14  list<string> Names = names;
15}
16
17class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>;
18
19class C<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Jr."))>;
20
21class D<list<string> names> : A<!foreach(Decls.name, names, !subst("NAME", "John Smith", Decls.name))>;
22
23class Names {
24  list<string> values = ["Ken Griffey", "Seymour Cray"];
25}
26
27def People : Names;
28
29def Seniors : B<People.values>;
30def Juniors : C<People.values>;
31def Smiths : D<["NAME", "Jane Smith"]>;
32def Unprocessed : D<People.values>;
33