aboutsummaryrefslogtreecommitdiff
path: root/test/TableGen
diff options
context:
space:
mode:
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/math.td15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/TableGen/math.td b/test/TableGen/math.td
new file mode 100644
index 0000000000..1f3a500f08
--- /dev/null
+++ b/test/TableGen/math.td
@@ -0,0 +1,15 @@
+// RUN: llvm-tblgen %s | FileCheck %s
+
+class Int<int value> {
+ int Value = value;
+}
+
+def v1024 : Int<1024>;
+// CHECK: Value = 1024
+
+def v1025 : Int<!add(v1024.Value, 1)>;
+// CHECK: Value = 1025
+
+def v2048 : Int<!add(v1024.Value, v1024.Value)>;
+// CHECK: Value = 2048
+