summaryrefslogtreecommitdiffstats
path: root/llvm/test/TableGen/self-reference.td
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/TableGen/self-reference.td')
-rw-r--r--llvm/test/TableGen/self-reference.td23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/TableGen/self-reference.td b/llvm/test/TableGen/self-reference.td
index 89d72343047..5789d3ba570 100644
--- a/llvm/test/TableGen/self-reference.td
+++ b/llvm/test/TableGen/self-reference.td
@@ -24,6 +24,14 @@
// CHECK: E e = E0;
// CHECK: }
+// CHECK: def F0 {
+// CHECK: Fa as_a = F0;
+// CHECK: Fb as_b = F0;
+// CHECK: }
+// CHECK: def F0x {
+// CHECK: Fc as_c = F0;
+// CHECK: }
+
def ops;
class A<dag d> {
@@ -73,3 +81,18 @@ class E<E x> {
// work here because E0 does not yet have E as a superclass while the template
// arguments are being parsed.
def E0 : E<!cast<E>("E0")>;
+
+// Ensure that records end up with the correct type even when direct self-
+// references are involved.
+class Fa;
+class Fb<Fa x> {
+ Fa as_a = x;
+}
+class Fc<Fb x> {
+ Fb as_b = x;
+}
+
+def F0 : Fa, Fb<F0>, Fc<F0>;
+def F0x {
+ Fc as_c = F0;
+}
OpenPOWER on IntegriCloud