[TableGen] Use the same anonymous name as the prefix on all multiclass defs
[oota-llvm.git] / test / TableGen / MultiClassDefName.td
index d3c6de7e842106a0dbc717fd1054bd0227f34fbf..69b951d378a19c2424471674e4fe1b067066fbb2 100644 (file)
@@ -14,3 +14,18 @@ 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">;
+