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: } 64 65 66def VAL4 : bar<foo2, somedef2>; 67// CHECK: def VAL4 { 68// CHECK-NEXT: dag Dag1 = (somedef1 1); 69// CHECK-NEXT: dag Dag2 = (somedef2 2); 70// CHECK-NEXT: dag Dag3 = (somedef2 2); 71// CHECK-NEXT: } 72 73def VAL5 : bar<foo2, somedef2> { 74 // Named operands. 75 let Dag1 = (somedef1 1:$name1); 76 77 // Name, no node. 78 let Dag2 = (somedef2 $name2, $name3); 79} 80 81// CHECK: def VAL5 { 82// CHECK-NEXT: dag Dag1 = (somedef1 1:$name1); 83// CHECK-NEXT: dag Dag2 = (somedef2 ?:$name2, ?:$name3); 84