llvm.org GIT mirror llvm / release_35@215010 test / TableGen / math.td
release_35@215010

Tree @release_35@215010 (Download .tar.gz)

math.td @release_35@215010raw · history · blame

// RUN: llvm-tblgen %s | FileCheck %s
// XFAIL: vg_leak

def shifts {
    bits<2> b = 0b10;
    int i = 2;
    int shifted_b = !shl(b, 2);
    int shifted_i = !shl(i, 2);
}
// CHECK: def shifts
// CHECK: shifted_b = 8
// CHECK: shifted_i = 8

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