2013-01-25 14:49:08 +00:00
|
|
|
// RUN: llvm-tblgen %s | FileCheck %s
|
2013-11-10 14:26:08 +00:00
|
|
|
// XFAIL: vg_leak
|
2013-01-25 14:49:08 +00:00
|
|
|
|
2014-07-17 17:04:27 +00:00
|
|
|
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
|
|
|
|
|
2013-01-25 14:49:08 +00:00
|
|
|
class Int<int value> {
|
|
|
|
int Value = value;
|
|
|
|
}
|
|
|
|
|
2014-08-05 09:43:25 +00:00
|
|
|
// CHECK: def v0
|
|
|
|
// CHECK: Value = 0
|
|
|
|
|
|
|
|
// CHECK: def v1
|
|
|
|
// CHECK: Value = 1
|
|
|
|
|
2013-01-25 14:49:08 +00:00
|
|
|
def v1024 : Int<1024>;
|
2013-01-25 20:29:25 +00:00
|
|
|
// CHECK: def v1024
|
2013-01-25 14:49:08 +00:00
|
|
|
// CHECK: Value = 1024
|
|
|
|
|
|
|
|
def v1025 : Int<!add(v1024.Value, 1)>;
|
2013-01-25 20:29:25 +00:00
|
|
|
// CHECK: def v1025
|
2013-01-25 14:49:08 +00:00
|
|
|
// CHECK: Value = 1025
|
|
|
|
|
|
|
|
def v2048 : Int<!add(v1024.Value, v1024.Value)>;
|
2013-01-25 20:29:25 +00:00
|
|
|
// CHECK: def v2048
|
2013-01-25 14:49:08 +00:00
|
|
|
// CHECK: Value = 2048
|
|
|
|
|
2014-08-05 09:43:25 +00:00
|
|
|
def v0 : Int<!and(v1024.Value, v2048.Value)>;
|
|
|
|
def v1 : Int<!and(v1025.Value, 1)>;
|