1 // RUN: tblgen %s | FileCheck %s 2 // XFAIL: vg_leak 3 4 //===----------------------------------------------------------------------===// 5 // Substitution of an int. 6 def X1; 7 8 class C1<int N> { 9 dag d = (X1 N); 10 } 11 12 def VAL1 : C1<13>; 13 14 // CHECK: def VAL1 { 15 // CHECK-NEXT: dag d = (X1 13) 16 17 18 //===----------------------------------------------------------------------===// 19 // Substitution of a DAG. 20 def X2; 21 22 class yclass; 23 def Y2 : yclass; 24 25 class C2<yclass N> { 26 dag d = (X2 N); 27 dag e = (N X2); 28 } 29 30 def 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 40 class operator; 41 def somedef1 : operator; 42 def somedef2 : operator; 43 44 class foo<operator a> { 45 operator TheOp = a; 46 } 47 48 class bar<foo F, operator a> { 49 dag Dag1 = (somedef1 1); 50 dag Dag2 = (a 2); 51 dag Dag3 = (F.TheOp 2); 52 } 53 54 def foo1 : foo<somedef1>; 55 def foo2 : foo<somedef2>; 56 57 def 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 66 def 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