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