TableGen: Support folding casts from bits to int
[oota-llvm.git] / test / TableGen / cast-list-initializer.td
diff --git a/test/TableGen/cast-list-initializer.td b/test/TableGen/cast-list-initializer.td
new file mode 100644 (file)
index 0000000..4c83773
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: llvm-tblgen %s | FileCheck %s
+
+class Foo<bits<8> b> {
+// CHECK: list<int> ListOfInts = [170];
+// CHECK: list<int> AnotherList = [170, 7];
+  list<int> ListOfInts = [!cast<int>(b)];
+  list<int> AnotherList = [!cast<int>(b), !cast<int>({1, 1, 1})];
+}
+
+def : Foo<{1, 0, 1, 0, 1, 0, 1, 0}>;