| Bill Wendling | 7c20aab | 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; |
| Bill Wendling | 7c20aab | 2013-08-22 20:46:05 +0000 | [diff] [blame] | 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; |
| Bill Wendling | 7c20aab | 2013-08-22 20:46:05 +0000 | [diff] [blame] | 14 | // CHECK-NEXT: } |
| David Greene | d571b3c | 2009-05-14 22:38:31 +0000 | [diff] [blame] | 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> : |
| David Greene | 2f7cf7f | 2011-01-07 17:05:37 +0000 | [diff] [blame] | 30 | List<Names>, CAR<!head(Names)>, CDR<!tail(Names), !empty(!tail(Names))>; |
| David Greene | d571b3c | 2009-05-14 22:38:31 +0000 | [diff] [blame] | 31 | |
| 32 | def Three : NameList<["Tom", "Dick", "Harry"]>; |
| 33 | |
| 34 | def One : NameList<["Jeffrey Sinclair"]>; |