• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-tblgen %s | FileCheck %s
2// XFAIL: vg_leak
3
4//===----------------------------------------------------------------------===//
5// Substitution of an int.
6def X1;
7
8class C1<int N> {
9  dag d = (X1 N);
10}
11
12def VAL1 : C1<13>;
13
14// CHECK: def VAL1 {
15// CHECK-NEXT: dag d = (X1 13)
16
17
18//===----------------------------------------------------------------------===//
19// Substitution of a DAG.
20def X2;
21
22class yclass;
23def Y2 : yclass;
24
25class C2<yclass N> {
26  dag d = (X2 N);
27  dag e = (N X2);
28}
29
30def VAL2 : C2<Y2>;
31
32// CHECK: def VAL2 {
33// CHECK-NEXT: dag d = (X2 Y2)
34// CHECK-NEXT: dag e = (Y2 X2)
35
36
37//===----------------------------------------------------------------------===//
38// Complex dag operator (F.TheOp).
39
40class operator;
41def somedef1 : operator;
42def somedef2 : operator;
43
44class foo<operator a> {
45 operator TheOp = a;
46}
47
48class bar<foo F, operator a> {
49  dag Dag1 = (somedef1 1);
50  dag Dag2 = (a 2);
51  dag Dag3 = (F.TheOp 2);
52}
53
54def foo1 : foo<somedef1>;
55def foo2 : foo<somedef2>;
56
57def VAL3 : bar<foo1, somedef1>;
58
59// CHECK:     def VAL3 {	// bar
60// CHECK-NEXT:  dag Dag1 = (somedef1 1);
61// CHECK-NEXT:  dag Dag2 = (somedef1 2);
62// CHECK-NEXT:  dag Dag3 = (somedef1 2);
63// CHECK-NEXT:  NAME = ?
64// CHECK-NEXT: }
65
66
67def VAL4 : bar<foo2, somedef2>;
68// CHECK:      def VAL4 {
69// CHECK-NEXT:  dag Dag1 = (somedef1 1);
70// CHECK-NEXT:  dag Dag2 = (somedef2 2);
71// CHECK-NEXT:  dag Dag3 = (somedef2 2);
72// CHECK-NEXT:  NAME = ?
73// CHECK-NEXT: }
74
75def VAL5 : bar<foo2, somedef2> {
76  // Named operands.
77  let Dag1 = (somedef1 1:$name1);
78
79  // Name, no node.
80  let Dag2 = (somedef2 $name2, $name3);
81}
82
83// CHECK:      def VAL5 {
84// CHECK-NEXT:  dag Dag1 = (somedef1 1:$name1);
85// CHECK-NEXT:  dag Dag2 = (somedef2 ?:$name2, ?:$name3);
86