MIR Serialization: Serialize the 'early-clobber' register operand flag.
[oota-llvm.git] / test / CodeGen / MIR / X86 / early-clobber-register-flag.mir
1 # RUN: llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses the 'early-clobber' register
3 # flags correctly.
4
5 --- |
6
7   declare void @foo(i32)
8
9   define void @test(i32 %a, i32 %b) #0 {
10   entry:
11     %c = add i32 %a, %b
12     call void asm sideeffect "nop", "~{ax},~{di}"()
13     call void @foo(i32 %c)
14     ret void
15   }
16
17   attributes #0 = { optsize }
18
19 ...
20 ---
21 name:            test
22 hasInlineAsm:    true
23 tracksRegLiveness: true
24 liveins:
25   - { reg: '%edi' }
26   - { reg: '%esi' }
27 frameInfo:
28   stackSize:     8
29   adjustsStack:  true
30   hasCalls:      true
31 body:
32   - id:          0
33     name:        entry
34     liveins:     [ '%edi', '%esi' ]
35     instructions:
36       - 'frame-setup PUSH64r undef %rax, implicit-def %rsp, implicit %rsp'
37       - CFI_INSTRUCTION .cfi_def_cfa_offset 16
38       - '%ecx = COPY %edi'
39       - '%ecx = ADD32rr killed %ecx, killed %esi, implicit-def dead %eflags'
40 # CHECK: INLINEASM $nop, 1, 12, implicit-def dead early-clobber %ax, 12, implicit-def dead early-clobber %di
41       - 'INLINEASM $nop, 1, 12, implicit-def dead early-clobber %ax, 12, implicit-def dead early-clobber %di'
42       - '%edi = COPY killed %ecx'
43       - 'CALL64pcrel32 @foo, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp'
44       - '%rax = POP64r implicit-def %rsp, implicit %rsp'
45       - RETQ
46 ...