blob: a4f1d9a073729768aa4e559c8ed5ea5c5ab6511c [file] [log] [blame]
Nicolai Haehnle18f19982018-03-19 14:14:10 +00001// RUN: llvm-tblgen %s | FileCheck %s
2// XFAIL: vg_leak
3
4// CHECK: --- Defs ---
5
6// CHECK: def A0 {
7// CHECK: dag a = (ops A0);
8// CHECK: }
9
10// CHECK: def B0 {
11// CHECK: dag a = (ops);
12// CHECK: A b = B0;
13// CHECK: }
14
15// CHECK: def C0 {
16// CHECK: dag q = (ops C0);
17// CHECK: }
18
19def ops;
20
21class A<dag d> {
22 dag a = d;
23}
24
25// This type of self-reference is used in various places defining register
26// classes.
27def A0 : A<(ops A0)>;
28
29class B<string self> {
30 A b = !cast<A>(self);
31}
32
33// A stronger form of this type of self-reference is used at least in the
34// SystemZ backend to define a record which is a ComplexPattern and an Operand
35// at the same time.
36def B0 : A<(ops)>, B<"B0">;
37
38// Casting C0 to C by name here is tricky, because it happens while (or rather:
39// before) adding C as a superclass. However, SystemZ uses this pattern.
40class C<string self> {
41 dag q = (ops !cast<C>(self));
42}
43
44def C0 : C<"C0">;