summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2018-02-22 15:27:03 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2018-02-22 15:27:03 +0000
commit8fb962c04ea2fd0a91f2dcd70e141ffc2c83d2d4 (patch)
treedfb559394eb3a7faff127126df06a4bed7b07aa7 /llvm/test
parent81097ba6b578172a7ff68fb5e86c48fd60ff8a67 (diff)
downloadbcm5719-llvm-8fb962c04ea2fd0a91f2dcd70e141ffc2c83d2d4.tar.gz
bcm5719-llvm-8fb962c04ea2fd0a91f2dcd70e141ffc2c83d2d4.zip
TableGen: Allow implicit casting between string and code
Summary: Perhaps the distinction between the two should be removed entirely in the long term, and the [{ ... }] syntax should just be a convenient way of writing multi-line strings. In the meantime, a lot of existing .td files are quite relaxed about string vs. code, and this change allows switching on more consistent type checks without breaking those. Change-Id: If85e3e04469e41b58e2703b62ac0032d2711713c Reviewers: arsenm, craig.topper, tra, MartinO Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D43557 llvm-svn: 325799
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/TableGen/code.td23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/TableGen/code.td b/llvm/test/TableGen/code.td
new file mode 100644
index 00000000000..1f983e28240
--- /dev/null
+++ b/llvm/test/TableGen/code.td
@@ -0,0 +1,23 @@
+// RUN: llvm-tblgen %s | FileCheck %s
+// XFAIL: vg_leak
+
+// CHECK: --- Defs ---
+
+// TODO: Both of these should result in CodeInits, i.e. print [{...}].
+// CHECK: def A0 {
+// CHECK: code Code = "Simple";
+// CHECK: }
+
+// CHECK: def B0 {
+// CHECK: code Code = "With paste 7";
+// CHECK: }
+
+class A<code c> {
+ code Code = c;
+}
+
+def A0 : A<"Simple">;
+
+class B<int i> : A<"With paste " # i>;
+
+def B0 : B<7>;
OpenPOWER on IntegriCloud