summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-05-02 19:25:52 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-05-02 19:25:52 +0000
commit1913eeb38536036a256ca96591dbc0f76e4bcf12 (patch)
tree032a91c343d41c6a4e996ed95fe319214d95bd2b /test
parentae8904c582f7b74541e124949d039a76c4cba046 (diff)
downloadllvm-1913eeb38536036a256ca96591dbc0f76e4bcf12.tar.gz
llvm-1913eeb38536036a256ca96591dbc0f76e4bcf12.tar.bz2
llvm-1913eeb38536036a256ca96591dbc0f76e4bcf12.tar.xz
[tablegen] !strconcat accepts more than two arguments but this wasn't documented or tested.
Summary: * Updated the documentation * Added a test for >2 arguments * Added a check for the lexical concatenation * Made the existing test a bit stricter. Reviewers: t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, llvm-commits Differential Revision: http://reviews.llvm.org/D3485 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/TableGen/strconcat.td14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/TableGen/strconcat.td b/test/TableGen/strconcat.td
index dfb1a94d82..f5d7512fd6 100644
--- a/test/TableGen/strconcat.td
+++ b/test/TableGen/strconcat.td
@@ -1,9 +1,21 @@
// RUN: llvm-tblgen %s | FileCheck %s
-// CHECK: fufoo
+// CHECK: class Y<string Y:S = ?> {
+// CHECK: string T = !strconcat(Y:S, "foo");
+// CHECK: string T2 = !strconcat(Y:S, !strconcat("foo", !strconcat(Y:S, "bar")));
+// CHECK: string S = "foobar";
+// CHECK: }
+
+// CHECK: def Z {
+// CHECK: string T = "fufoo";
+// CHECK: string T2 = "fufoofubar";
+// CHECK: string S = "foobar";
+// CHECK: }
class Y<string S> {
string T = !strconcat(S, "foo");
+ // More than two arguments is equivalent to nested calls
+ string T2 = !strconcat(S, "foo", S, "bar");
// String values concatenate lexically, as in C.
string S = "foo" "bar";