brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · d709b18 Raw
50 lines · plain
1// RUN: llvm-tblgen %s | FileCheck %s2// RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s3// XFAIL: vg_leak4 5// CHECK: def A16// CHECK:   code CodeCode = [{code here;}]7// CHECK:   code StringCode = [{code here;}]8 9// CHECK: def A210// CHECK:   string CodeCode = "string here"11// CHECK:   string StringCode = "string here"12 13// CHECK: def B114// CHECK:   string CodeCode = "with paste 7"15// CHECK:   string StringCode = "with paste 7"16 17// CHECK: def C118// CHECK:   code CodeCode = [{with concat 42}]19// CHECK:   code StringCode = [{with concat 42}]20 21// CHECK: def D122// CHECK:   code CodeCode = [{with concat 108!}]23// CHECK:   code StringCode = [{with concat 108!}]24 25class A<code c> {26  code CodeCode = c;27  string StringCode = c;28}29 30def A1 : A<[{code here;}]>;31def A2 : A<"string here">;32 33class B<int i> : A<"with paste " # i>;34class C<int i> : A<!strconcat([{with concat }], !cast<string>(i))>;35class D<int i> : A<!strconcat([{with concat }], !cast<string>(i), "!")>;36 37def B1 : B<7>;38def C1 : C<42>;39def D1 : D<108>;40 41#ifdef ERROR142 43// ERROR1: the 'code' type is not allowed44 45def Zerror1 {46  code Code = !cast<code>("i = 0;");47}48 49#endif50