~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to test/TableGen/LoLoL.td

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-03-29 19:09:51 UTC
  • Revision ID: package-import@ubuntu.com-20120329190951-aq83ivog4cg8bxun
Tags: upstream-3.1~svn153643
ImportĀ upstreamĀ versionĀ 3.1~svn153643

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// RUN: llvm-tblgen %s | FileCheck %s
 
2
// XFAIL: vg_leak
 
3
 
 
4
class Base<list<int> v> {
 
5
  list<int> values = v;
 
6
}
 
7
 
 
8
class Derived<list<int> v> : Base<!if(!empty(v),[0],v)>;
 
9
 
 
10
multiclass Multi<list<list<list<int>>> v> {
 
11
  def ONE : Derived<!if(!empty(v),[]<int>,!if(!empty(!head(v)),[]<int>,v[0][0]))>;
 
12
  def TWO : Derived<!if(!empty(v),[]<int>,!if(!empty(!tail(v)),!if(!empty(!head(v)),[]<int>,v[0][0]),v[1][0]))>;
 
13
}
 
14
 
 
15
defm Def : Multi<[[[]],[[1, 2, 3]]]>;
 
16
 
 
17
// CHECK: values = [0]
 
18
// CHECK: values = [1, 2, 3]