diff options
Diffstat (limited to 'test/TableGen/math.td')
-rw-r--r-- | test/TableGen/math.td | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/TableGen/math.td b/test/TableGen/math.td index 59d16ae..d966346 100644 --- a/test/TableGen/math.td +++ b/test/TableGen/math.td @@ -1,10 +1,26 @@ // 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; } +// CHECK: def v0 +// CHECK: Value = 0 + +// CHECK: def v1 +// CHECK: Value = 1 + def v1024 : Int<1024>; // CHECK: def v1024 // CHECK: Value = 1024 @@ -17,3 +33,5 @@ def v2048 : Int<!add(v1024.Value, v1024.Value)>; // CHECK: def v2048 // CHECK: Value = 2048 +def v0 : Int<!and(v1024.Value, v2048.Value)>; +def v1 : Int<!and(v1025.Value, 1)>; |