summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/docs/TableGen/LangIntro.rst4
-rw-r--r--llvm/test/TableGen/strconcat.td14
2 files changed, 16 insertions, 2 deletions
diff --git a/llvm/docs/TableGen/LangIntro.rst b/llvm/docs/TableGen/LangIntro.rst
index f139f359649..5b6094fa91f 100644
--- a/llvm/docs/TableGen/LangIntro.rst
+++ b/llvm/docs/TableGen/LangIntro.rst
@@ -160,8 +160,10 @@ supported include:
remaining elements in the list may be arbitrary other values, including
nested ```dag``' values.
-``!strconcat(a, b)``
+``!strconcat(a, b, ...)``
A string value that is the result of concatenating the 'a' and 'b' strings.
+ More than two arguments are accepted with the result being the concatenation
+ of all the strings given.
``str1#str2``
"#" (paste) is a shorthand for !strconcat. It may concatenate things that
diff --git a/llvm/test/TableGen/strconcat.td b/llvm/test/TableGen/strconcat.td
index dfb1a94d82c..f5d7512fd69 100644
--- a/llvm/test/TableGen/strconcat.td
+++ b/llvm/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";
OpenPOWER on IntegriCloud