40 lines · plain
1// RUN: llvm-tblgen --no-warn-on-unused-template-args %s | FileCheck %s2// XFAIL: vg_leak3 4// CHECK: --- Defs ---5 6// CHECK: def X0 {7// CHECK: int ret = 0;8// CHECK: }9 10// CHECK: def X1 {11// CHECK: int ret = 1;12// CHECK: }13 14// CHECK: def Y0 {15// CHECK: int ret = 0;16// CHECK: }17 18// CHECK: def Y1 {19// CHECK: int ret = 11;20// CHECK: }21 22class A<int dummy>;23class B<int num> : A<num> {24 int Num = num;25}26 27class X<A a> {28 int ret = !isa<B>(a);29}30 31class Y<A a> {32 int ret = !if(!isa<B>(a), !cast<B>(a).Num, 0);33}34 35def X0 : X<A<0>>;36def X1 : X<B<0>>;37 38def Y0 : Y<A<10>>;39def Y1 : Y<B<11>>;40