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