aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/TableGen/BitsInitOverflow.td5
-rw-r--r--test/TableGen/IntBitInit.td5
-rw-r--r--test/TableGen/ListConversion.td10
3 files changed, 20 insertions, 0 deletions
diff --git a/test/TableGen/BitsInitOverflow.td b/test/TableGen/BitsInitOverflow.td
new file mode 100644
index 0000000000..c0b5da90dd
--- /dev/null
+++ b/test/TableGen/BitsInitOverflow.td
@@ -0,0 +1,5 @@
+// RUN: not tblgen %s
+
+def {
+ bits<2> X = 5; // bitfield is too small, reject
+}
diff --git a/test/TableGen/IntBitInit.td b/test/TableGen/IntBitInit.td
new file mode 100644
index 0000000000..b949bfea7b
--- /dev/null
+++ b/test/TableGen/IntBitInit.td
@@ -0,0 +1,5 @@
+// RUN: tblgen %s
+def {
+ bit A = 1;
+ int B = A;
+}
diff --git a/test/TableGen/ListConversion.td b/test/TableGen/ListConversion.td
new file mode 100644
index 0000000000..773ed6e4d1
--- /dev/null
+++ b/test/TableGen/ListConversion.td
@@ -0,0 +1,10 @@
+// RUN: tblgen %s
+class A;
+class B : A;
+
+def b : B;
+
+def {
+ list<B> X = [b];
+ list<A> Y = X;
+}