MIR Serialization: Change MIR syntax - use custom syntax for MBBs.
[oota-llvm.git] / test / CodeGen / MIR / X86 / expected-named-register-in-callee-saved-register.mir
index bd9e70420b5ff249d93672b3f996103d09c95805..be57734ecf33c68aebcd976d7d067348db4e5bad 100644 (file)
 ---
 name:            compute
 tracksRegLiveness: true
-body:
-  - id:          0
-    name:        body
-    liveins:     [ '%edi' ]
-    instructions:
-      - '%eax = COPY killed %edi'
-      - 'RETQ killed %eax'
+body: |
+  bb.0.body:
+    liveins: %edi
+
+    %eax = COPY killed %edi
+    RETQ killed %eax
 ...
 ---
 name:            func
@@ -53,39 +52,37 @@ fixedStack:
   - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '%0' }
 stack:
   - { id: 0, name: b, offset: -20, size: 4, alignment: 4 }
-body:
-  - id:          0
-    name:        entry
-    successors:  [ '%bb.1.check' ]
-    liveins:     [ '%edi', '%rbx' ]
-    instructions:
-      - 'frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp'
-      - '%rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags'
-      - '%ebx = COPY %edi'
-      - 'MOV32mr %rsp, 1, _, 12, _, %ebx'
-  - id:          1
-    name:        check
-    successors:  [ '%bb.2.loop', '%bb.3.exit' ]
-    liveins:     [ '%ebx' ]
-    instructions:
-      - 'CMP32ri8 %ebx, 10, implicit-def %eflags'
-      - 'JG_1 %bb.3.exit, implicit killed %eflags'
-      - 'JMP_1 %bb.2.loop'
-  - id:          2
-    name:        loop
-    successors:  [ '%bb.1.check' ]
-    liveins:     [ '%ebx' ]
-    instructions:
-      - '%edi = MOV32rm %rsp, 1, _, 12, _'
-      - 'CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax'
-      - '%eax = DEC32r killed %eax, implicit-def dead %eflags'
-      - 'MOV32mr %rsp, 1, _, 12, _, killed %eax'
-      - 'JMP_1 %bb.1.check'
-  - id:          3
-    name:        exit
-    instructions:
-      - '%eax = MOV32r0 implicit-def dead %eflags'
-      - '%rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags'
-      - '%rbx = POP64r implicit-def %rsp, implicit %rsp'
-      - 'RETQ %eax'
+body: |
+  bb.0.entry:
+    successors: %bb.1.check
+    liveins: %edi, %rbx
+
+    frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp
+    %rsp = frame-setup SUB64ri8 %rsp, 16, implicit-def dead %eflags
+    %ebx = COPY %edi
+    MOV32mr %rsp, 1, _, 12, _, %ebx
+
+  bb.1.check:
+    successors: %bb.2.loop, %bb.3.exit
+    liveins: %ebx
+
+    CMP32ri8 %ebx, 10, implicit-def %eflags
+    JG_1 %bb.3.exit, implicit killed %eflags
+    JMP_1 %bb.2.loop
+
+  bb.2.loop:
+    successors: %bb.1.check
+    liveins: %ebx
+
+    %edi = MOV32rm %rsp, 1, _, 12, _
+    CALL64pcrel32 @compute, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax
+    %eax = DEC32r killed %eax, implicit-def dead %eflags
+    MOV32mr %rsp, 1, _, 12, _, killed %eax
+    JMP_1 %bb.1.check
+
+  bb.3.exit:
+    %eax = MOV32r0 implicit-def dead %eflags
+    %rsp = ADD64ri8 %rsp, 16, implicit-def dead %eflags
+    %rbx = POP64r implicit-def %rsp, implicit %rsp
+    RETQ %eax
 ...