1 // RUN: llvm-tblgen %s | FileCheck %s
5 class A<list<list<int>> vals> {
6 list<int> first = vals[0];
7 list<int> rest = !cond(!empty(!tail(vals)): vals[0],
11 def A_OneEl : A<[[1,2,3]]>;
12 // CHECK: def A_OneEl { // A
13 // CHECK-NEXT: list<int> first = [1, 2, 3];
14 // CHECK-NEXT: list<int> rest = [1, 2, 3];
17 def A_TwoEl : A<[[1,2,3], [4,5,6]]>;
18 // CHECK: def A_TwoEl { // A
19 // CHECK-NEXT: list<int> first = [1, 2, 3];
20 // CHECK-NEXT: list<int> rest = [4, 5, 6];
24 class B<list<int> v> {
27 class BB<list<list<int>> vals> : B<!cond(!empty(!tail(vals)): vals[0], 1 : vals[1])>;
28 class BBB<list<list<int>> vals> : BB<vals>;
30 def B_OneEl : BBB<[[1,2,3]]>;
31 // CHECK: def B_OneEl { // B BB BBB
32 // CHECK-NEXT: list<int> vals = [1, 2, 3];
35 def B_TwoEl : BBB<[[1,2,3],[4,5,6]]>;
36 // CHECK: def B_TwoEl { // B BB BBB
37 // CHECK-NEXT: list<int> vals = [4, 5, 6];