aboutsummaryrefslogtreecommitdiffstats
path: root/test/TableGen
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-04-23 16:57:46 -0700
committerStephen Hines <srhines@google.com>2014-04-24 15:53:16 -0700
commit36b56886974eae4f9c5ebc96befd3e7bfe5de338 (patch)
treee6cfb69fbbd937f450eeb83bfb83b9da3b01275a /test/TableGen
parent69a8640022b04415ae9fac62f8ab090601d8f889 (diff)
downloadexternal_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.zip
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.gz
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.bz2
Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
Diffstat (limited to 'test/TableGen')
-rw-r--r--test/TableGen/MultiClassDefName.td25
-rw-r--r--test/TableGen/ValidIdentifiers.td16
2 files changed, 41 insertions, 0 deletions
diff --git a/test/TableGen/MultiClassDefName.td b/test/TableGen/MultiClassDefName.td
index d3c6de7..811d9266 100644
--- a/test/TableGen/MultiClassDefName.td
+++ b/test/TableGen/MultiClassDefName.td
@@ -14,3 +14,28 @@ multiclass Names<string n, string m> {
}
defm Hello : Names<"hello", "world">;
+
+// Ensure that the same anonymous name is used as the prefix for all defs in an
+// anonymous multiclass.
+
+class Outer<C i> {
+ C Inner = i;
+}
+
+multiclass MC<string name> {
+ def hi : C<name>;
+ def there : Outer<!cast<C>(!strconcat(NAME, "hi"))>;
+}
+
+defm : MC<"foo">;
+
+multiclass MC2<string name> {
+ def there : Outer<C<name> >;
+}
+
+// Ensure that we've correctly captured the reference to name from the implicit
+// anonymous C def in the template parameter list of Outer.
+// CHECK-NOT: MC2::name
+
+defm : MC2<"bar">;
+
diff --git a/test/TableGen/ValidIdentifiers.td b/test/TableGen/ValidIdentifiers.td
new file mode 100644
index 0000000..333ede0
--- /dev/null
+++ b/test/TableGen/ValidIdentifiers.td
@@ -0,0 +1,16 @@
+// RUN: llvm-tblgen -gen-ctags %s | FileCheck %s
+// XFAIL: vg_leak
+
+// Ensure that generated names for anonymous records are valid identifiers via the ctags index.
+
+class foo<int X> { int THEVAL = X; }
+// CHECK: {{^X }}
+
+def : foo<2>;
+// CHECK: {{^anonymous_0 }}
+
+def X {
+ foo Y = foo<1>;
+}
+// CHECK: {{^anonymous_1 }}
+// CHECK: {{^foo }}