1 // RUN: llvm-tblgen %s 2 3 // CHECK: def One { 4 // CHECK-NEXT: list<string> names = ["Jeffrey Sinclair"]; 5 // CHECK-NEXT: string element = "Jeffrey Sinclair"; 6 // CHECK-NEXT: list<string> rest = []; 7 // CHECK-NEXT: int null = 1; 8 // CHECK-NEXT: } 9 // CHECK-NEXT: def Three { 10 // CHECK-NEXT: list<string> names = ["Tom", "Dick", "Harry"]; 11 // CHECK-NEXT: string element = "Tom"; 12 // CHECK-NEXT: list<string> rest = ["Dick", "Harry"]; 13 // CHECK-NEXT: int null = 0; 14 // CHECK-NEXT: } 15 16 class List<list<string> n> { 17 list<string> names = n; 18 } 19 20 class CAR<string e> { 21 string element = e; 22 } 23 24 class CDR<list<string> r, int n> { 25 list<string> rest = r; 26 int null = n; 27 } 28 29 class NameList<list<string> Names> : 30 List<Names>, CAR<!head(Names)>, CDR<!tail(Names), !empty(!tail(Names))>; 31 32 def Three : NameList<["Tom", "Dick", "Harry"]>; 33 34 def One : NameList<["Jeffrey Sinclair"]>; 35