1 // RUN: llvm-tblgen %s | FileCheck %s
2 // RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
6 // CHECK: code CodeCode = [{code here;}]
7 // CHECK: code StringCode = [{code here;}]
10 // CHECK: string CodeCode = "string here"
11 // CHECK: string StringCode = "string here"
14 // CHECK: string CodeCode = "with paste 7"
15 // CHECK: string StringCode = "with paste 7"
18 // CHECK: code CodeCode = [{with concat 42}]
19 // CHECK: code StringCode = [{with concat 42}]
22 // CHECK: code CodeCode = [{with concat 108!}]
23 // CHECK: code StringCode = [{with concat 108!}]
27 string StringCode = c;
30 def A1 : A<[{code here;}]>;
31 def A2 : A<"string here">;
33 class B<int i> : A<"with paste " # i>;
34 class C<int i> : A<!strconcat([{with concat }], !cast<string>(i))>;
35 class D<int i> : A<!strconcat([{with concat }], !cast<string>(i), "!")>;
43 // ERROR1: the 'code' type is not allowed
46 code Code = !cast<code>("i = 0;");