1# RUN: llc -mtriple=x86_64-unknown-linux -start-before=x86-flags-copy-lowering -o - %s | FileCheck %s 2# 3# Test the emission of pre- and post-instruction labels. 4 5--- | 6 declare void @f(i32 %x) nounwind 7 8 declare void @g(i32 %x) nounwind 9 10 declare void @h(i32 %x) nounwind 11 12 define i64 @test(i32 %x) nounwind { 13 entry: 14 call void @f(i32 %x) 15 call void @g(i32 %x) 16 call void @h(i32 %x) 17 ret i64 undef 18 } 19 20... 21--- 22name: test 23# CHECK-LABEL: {{^}}test: 24tracksRegLiveness: true 25frameInfo: 26 hasCalls: true 27body: | 28 bb.0.entry: 29 liveins: $edi 30 31 %0:gr32 = COPY $edi 32 %1:gr32 = COPY killed %0 33 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp 34 $edi = COPY %1 35 36 CALL64pcrel32 @f, csr_64, implicit $rsp, implicit $ssp, implicit $edi, pre-instr-symbol <mcsymbol .Lpre_f>, post-instr-symbol <mcsymbol .Lpost_f> 37 ; CHECK: .Lpre_f: 38 ; CHECK-NEXT: callq f 39 ; CHECK-NEXT: .Lpost_f: 40 41 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp 42 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp 43 $edi = COPY %1 44 45 CALL64pcrel32 @g, csr_64, implicit $rsp, implicit $ssp, implicit $edi, pre-instr-symbol <mcsymbol .Lpre_g> 46 ; CHECK: .Lpre_g: 47 ; CHECK-NEXT: callq g 48 49 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp 50 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp 51 $edi = COPY %1 52 53 CALL64pcrel32 @h, csr_64, implicit $rsp, implicit $ssp, implicit $edi, post-instr-symbol <mcsymbol .Lpost_h> 54 ; CHECK: callq h 55 ; CHECK-NEXT: .Lpost_h: 56 57 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp 58 59 %2:gr64 = MOV64ri32 <mcsymbol .Lpre_f> 60 %3:gr64 = MOV64ri32 <mcsymbol .Lpost_f> 61 %4:gr64 = MOV64ri32 <mcsymbol .Lpre_g> 62 %5:gr64 = MOV64ri32 <mcsymbol .Lpost_h> 63 ; CHECK: movq $.Lpre_f, %{{.*}} 64 ; CHECK-NEXT: movq $.Lpost_f, %{{.*}} 65 ; CHECK-NEXT: movq $.Lpre_g, %{{.*}} 66 ; CHECK-NEXT: movq $.Lpost_h, %{{.*}} 67 68 %6:gr64 = ADD64rr killed %2, killed %3, implicit-def $eflags 69 %7:gr64 = ADD64rr killed %4, killed %5, implicit-def $eflags 70 %8:gr64 = ADD64rr killed %6, killed %7, implicit-def $eflags 71 $rax = COPY %8 72 RETQ implicit $rax 73 74... 75