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