blob: d753fbd299ce831c9478b03cbb3c7529c3318673 [file] [log] [blame]
Bill Wendlingb4be7f62013-08-22 20:46:05 +00001// 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: string NAME = ?;
9// CHECK-NEXT: }
10// CHECK-NEXT: def Three {
11// CHECK-NEXT: list<string> names = ["Tom", "Dick", "Harry"];
12// CHECK-NEXT: string element = "Tom";
13// CHECK-NEXT: list<string> rest = ["Dick", "Harry"];
14// CHECK-NEXT: int null = 0;
15// CHECK-NEXT: string NAME = ?;
16// CHECK-NEXT: }
David Greene5f9f9ba2009-05-14 22:38:31 +000017
18class List<list<string> n> {
19 list<string> names = n;
20}
21
22class CAR<string e> {
23 string element = e;
24}
25
26class CDR<list<string> r, int n> {
27 list<string> rest = r;
28 int null = n;
29}
30
31class NameList<list<string> Names> :
David Greene1434f662011-01-07 17:05:37 +000032 List<Names>, CAR<!head(Names)>, CDR<!tail(Names), !empty(!tail(Names))>;
David Greene5f9f9ba2009-05-14 22:38:31 +000033
34def Three : NameList<["Tom", "Dick", "Harry"]>;
35
36def One : NameList<["Jeffrey Sinclair"]>;