aboutsummaryrefslogtreecommitdiffstats
path: root/test/TableGen/math.td
blob: bde267a652dcb2def3492d1ef5fc8030efe2297e (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

class Int<int value> {
  int Value = value;
}

def v1024   : Int<1024>;
// CHECK: def v1024
// CHECK: Value = 1024

def v1025   : Int<!add(v1024.Value, 1)>;
// CHECK: def v1025
// CHECK: Value = 1025

def v2048   : Int<!add(v1024.Value, v1024.Value)>;
// CHECK: def v2048
// CHECK: Value = 2048