xref: /minix3/external/bsd/llvm/dist/llvm/test/TableGen/LoLoL.td (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: llvm-tblgen %s | FileCheck %s
2*f4a2713aSLionel Sambuc// XFAIL: vg_leak
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambucclass Base<list<int> v> {
5*f4a2713aSLionel Sambuc  list<int> values = v;
6*f4a2713aSLionel Sambuc}
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucclass Derived<list<int> v> : Base<!if(!empty(v),[0],v)>;
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambucmulticlass Multi<list<list<list<int>>> v> {
11*f4a2713aSLionel Sambuc  def ONE : Derived<!if(!empty(v),[]<int>,!if(!empty(!head(v)),[]<int>,v[0][0]))>;
12*f4a2713aSLionel Sambuc  def TWO : Derived<!if(!empty(v),[]<int>,!if(!empty(!tail(v)),!if(!empty(!head(v)),[]<int>,v[0][0]),v[1][0]))>;
13*f4a2713aSLionel Sambuc}
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambucdefm Def : Multi<[[[]],[[1, 2, 3]]]>;
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc// CHECK: values = [0]
18*f4a2713aSLionel Sambuc// CHECK: values = [1, 2, 3]
19