Bill Wendling | b4be7f6 | 2013-08-22 20:46:05 +0000 | [diff] [blame^] | 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: 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 Greene | 5f9f9ba | 2009-05-14 22:38:31 +0000 | [diff] [blame] | 17 | |
| 18 | class List<list<string> n> { |
| 19 | list<string> names = n; |
| 20 | } |
| 21 | |
| 22 | class CAR<string e> { |
| 23 | string element = e; |
| 24 | } |
| 25 | |
| 26 | class CDR<list<string> r, int n> { |
| 27 | list<string> rest = r; |
| 28 | int null = n; |
| 29 | } |
| 30 | |
| 31 | class NameList<list<string> Names> : |
David Greene | 1434f66 | 2011-01-07 17:05:37 +0000 | [diff] [blame] | 32 | List<Names>, CAR<!head(Names)>, CDR<!tail(Names), !empty(!tail(Names))>; |
David Greene | 5f9f9ba | 2009-05-14 22:38:31 +0000 | [diff] [blame] | 33 | |
| 34 | def Three : NameList<["Tom", "Dick", "Harry"]>; |
| 35 | |
| 36 | def One : NameList<["Jeffrey Sinclair"]>; |