llvm.org GIT mirror llvm / 90b6e34
Test More Complicated Lists Test of indexing lists of lists of lists works. This also exercises some operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140884 91177308-0d34-0410-b5e6-96231b3b80d8 David Greene 7 years ago
1 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 // RUN: tblgen %s | FileCheck %s
1
2 class Base v> {
3 list values = v;
4 }
5
6 class Derived v> : Base;
7
8 multiclass Multi>> v> {
9 def ONE : Derived,!if(!empty(!head(v)),[],v[0][0]))>;
10 def TWO : Derived,!if(!empty(!tail(v)),!if(!empty(!head(v)),[],v[0][0]),v[1][0]))>;
11 }
12
13 defm Def : Multi<[[[]],[[1, 2, 3]]]>;
14
15 // CHECK: values = [0]
16 // CHECK: values = [1, 2, 3]