aboutsummaryrefslogtreecommitdiff
path: root/test/TableGen/MultiDef.td
blob: f4527ac6f26e8d1460db397ca0048b2a34d63710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: llvm-tblgen %s | FileCheck %s
// RUN: llvm-tblgen %s | FileCheck %s

class Base<int i> {
  int value = i;
}

multiclass Multi<list<int> values> {
  def ONE : Base<values[0]>;
  def TWO : Base<values[1]>;

  multidef COUNT<values, int v, 2> : Base<v>;
}

defm List : Multi<[1, 2, 3, 4, 5, 6]>;

// CHECK: MD4.ListCOUNT
// CHECK: int value = 6