summaryrefslogtreecommitdiff
path: root/test/TableGen
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-12-21 18:51:00 +0000
committerAlp Toker <alp@nuanti.com>2013-12-21 18:51:00 +0000
commitcee93e95a4bb45e44d6029404fc47084e48b7775 (patch)
tree35ee8f09c82d0ecc0b99f0c4a4c5d0f642595541 /test/TableGen
parentefe6aa1adb625dc3027c5e47466e694b4ac2e1d8 (diff)
downloadllvm-cee93e95a4bb45e44d6029404fc47084e48b7775.tar.gz
llvm-cee93e95a4bb45e44d6029404fc47084e48b7775.tar.bz2
llvm-cee93e95a4bb45e44d6029404fc47084e48b7775.tar.xz
TableGen: Generate valid identifiers for anonymous records
Backends like OptParserEmitter assume that record names can be used as valid identifiers. The period '.' in generated anonymous names broke that assumption, causing a build-time error and in practice forcing all records to be named. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/ValidIdentifiers.td13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/TableGen/ValidIdentifiers.td b/test/TableGen/ValidIdentifiers.td
new file mode 100644
index 0000000000..899ae0e386
--- /dev/null
+++ b/test/TableGen/ValidIdentifiers.td
@@ -0,0 +1,13 @@
+// Ensure that anonymous names are valid identifiers via the ctags index
+// RUN: llvm-tblgen -gen-ctags %s | grep -v '^!' | not grep -viE '^[a-z_][a-z0-9_]*\t'
+// Test validation
+// RUN: llvm-tblgen -gen-ctags %s | grep '^anonymous' > /dev/null
+// XFAIL: vg_leak
+
+class foo<int X> { int THEVAL = X; }
+
+def : foo<2>;
+
+def X {
+ foo Y = foo<1>;
+}