1 // RUN: llvm-tblgen %s | FileCheck %s
4 //===----------------------------------------------------------------------===//
5 // Substitution of an int.
15 // CHECK-NEXT: dag d = (X1 13)
18 //===----------------------------------------------------------------------===//
19 // Substitution of a DAG.
33 // CHECK-NEXT: dag d = (X2 Y2)
34 // CHECK-NEXT: dag e = (Y2 X2)
37 //===----------------------------------------------------------------------===//
38 // Complex dag operator (F.TheOp).
41 def somedef1 : operator;
42 def somedef2 : operator;
44 class foo<operator a> {
48 class bar<foo F, operator a> {
49 dag Dag1 = (somedef1 1);
51 dag Dag3 = (F.TheOp 2);
54 def foo1 : foo<somedef1>;
55 def foo2 : foo<somedef2>;
57 def VAL3 : bar<foo1, somedef1>;
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 = ?
67 def VAL4 : bar<foo2, somedef2>;
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 = ?
75 def VAL5 : bar<foo2, somedef2> {
77 let Dag1 = (somedef1 1:$name1);
80 let Dag2 = (somedef2 $name2, $name3);
84 // CHECK-NEXT: dag Dag1 = (somedef1 1:$name1);
85 // CHECK-NEXT: dag Dag2 = (somedef2 ?:$name2, ?:$name3);