summaryrefslogtreecommitdiff
path: root/test/TableGen
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-12-21 21:21:34 +0000
committerDavid Greene <greened@obbligato.org>2009-12-21 21:21:34 +0000
commitf660802f348e4e57ef9df8d30be74b894259badb (patch)
tree4ad5603c0f42c4d15e5b60b3c5a3464cf1842ab9 /test/TableGen
parent7b1eb8a4091ff4e76323ce2d4a42d5d14b5e3f50 (diff)
Fix a bug in !subst where TableGen would go and resubstitute text it had
just substituted. This could cause infinite looping in certain pathological cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/subst2.td15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/TableGen/subst2.td b/test/TableGen/subst2.td
new file mode 100644
index 00000000000..3366c9d9cf7
--- /dev/null
+++ b/test/TableGen/subst2.td
@@ -0,0 +1,15 @@
+// RUN: tblgen %s | FileCheck %s
+// CHECK: No subst
+// CHECK: No foo
+// CHECK: RECURSE foo
+
+class Recurse<string t> {
+ string Text = t;
+}
+
+class Text<string text> :
+ Recurse<!subst("RECURSE", "RECURSE", !subst("NORECURSE", "foo", text))>;
+
+def Ok1 : Text<"No subst">;
+def Ok2 : Text<"No NORECURSE">;
+def Trouble : Text<"RECURSE NORECURSE">;