1 // RUN: llvm-tblgen %s | FileCheck %s
3 class PrintString<string s> {
8 def case_01 : PrintString<!repr((op op, op))>;
9 // CHECK-LABEL: def case_01 { // PrintString
10 // CHECK-NEXT: string S = "(op op, op)";
13 def case_02 : PrintString<!repr(32)>;
14 // CHECK-LABEL: def case_02 { // PrintString
15 // CHECK-NEXT: string S = "32";
18 multiclass Multi<int i, bits<3> b> {
19 defvar IncI = !repr(!add(i,1));
20 def _IncI : PrintString<IncI>;
21 def _b : PrintString<!repr(b)>;
24 defm case_03 : Multi<2, 0b111>;
25 // CHECK-LABEL: def case_03_IncI { // PrintString
26 // CHECK-NEXT: string S = "3";
28 // CHECK-LABEL: def case_03_b { // PrintString
29 // CHECK-NEXT: string S = "{ 1, 1, 1 }";
32 def case_04 : PrintString<!repr(!foreach(i, [1,2,3], !mul(i,2)))>;
33 // CHECK-LABEL: def case_04 { // PrintString
34 // CHECK-NEXT: string S = "[2, 4, 6]";
37 // Show the dumping of full records...
38 def case_05 : PrintString<!repr(case_04)>;
39 // CHECK-LABEL: def case_05 { // PrintString
40 // CHECK-NEXT: string S = "case_04 { // PrintString
41 // CHECK-NEXT: string S = "[2, 4, 6]";
46 // ... and how !repr differs compared to !cast<string>.
47 def case_06 : PrintString<!cast<string>(case_04)>;
48 // CHECK-LABEL: def case_06 { // PrintString
49 // CHECK-NEXT: string S = "case_04";