summaryrefslogtreecommitdiffstats
path: root/llvm/test/TableGen/foreach-range-parse-errors4.td
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/TableGen/foreach-range-parse-errors4.td')
-rw-r--r--llvm/test/TableGen/foreach-range-parse-errors4.td9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/TableGen/foreach-range-parse-errors4.td b/llvm/test/TableGen/foreach-range-parse-errors4.td
new file mode 100644
index 00000000000..6072b9b589d
--- /dev/null
+++ b/llvm/test/TableGen/foreach-range-parse-errors4.td
@@ -0,0 +1,9 @@
+// RUN: not llvm-tblgen %s 2>&1 | FileCheck -DFILE=%s %s
+// Make sure there is no crash on undefined variable
+
+// CHECK: [[FILE]]:[[@LINE+2]]:17: error: Variable not defined: 'foo'
+// CHECK: [[FILE]]:[[@LINE+1]]:21: error: expected declaration in for
+foreach Index = foo in {
+ def arst#Index;
+}
+
OpenPOWER on IntegriCloud