83 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass none -o - %s | FileCheck %s2# This test ensures that the MIR parser parses pre- and post-instruction symbols3# and MCSymbol operands correctly.4 5--- |6 declare void @f(i32 %x) nounwind7 8 declare void @g(i32 %x) nounwind9 10 declare void @h(i32 %x) nounwind11 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), !dbg !917 ret i64 poison18 }19 20 !llvm.dbg.cu = !{!0}21 !llvm.module.flags = !{!6, !7}22 23 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)24 !1 = !DIFile(filename: "test.ll", directory: "")25 !2 = !{}26 !4 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 4, type: !2, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)27 !5 = !DIFile(filename: "test.c", directory: "")28 !6 = !{i32 2, !"Dwarf Version", i32 4}29 !7 = !{i32 2, !"Debug Info Version", i32 3}30 !9 = !DILocation(line: 1, scope: !4)31 32...33---34name: test35# CHECK-LABEL: name: test36tracksRegLiveness: true37frameInfo:38 hasCalls: true39body: |40 bb.0.entry:41 liveins: $edi42 43 %0:gr32 = COPY $edi44 %1:gr32 = COPY killed %045 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp46 $edi = COPY %147 48 CALL64pcrel32 @f, csr_64, implicit $rsp, implicit $ssp, implicit $edi, pre-instr-symbol <mcsymbol .Lpre_f>, post-instr-symbol <mcsymbol .Lpost_f>49 ; CHECK: CALL64pcrel32 @f, {{.*}}, pre-instr-symbol <mcsymbol .Lpre_f>, post-instr-symbol <mcsymbol .Lpost_f>50 51 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp52 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp53 $edi = COPY %154 55 CALL64pcrel32 @g, csr_64, implicit $rsp, implicit $ssp, implicit $edi, pre-instr-symbol <mcsymbol .Lpre_g>56 ; CHECK: CALL64pcrel32 @g, {{.*}}, pre-instr-symbol <mcsymbol .Lpre_g>57 58 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp59 ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp60 $edi = COPY %161 62 CALL64pcrel32 @h, csr_64, implicit $rsp, implicit $ssp, implicit $edi, post-instr-symbol <mcsymbol .Lpost_h>, debug-location !963 ; CHECK: CALL64pcrel32 @h, {{.*}}, post-instr-symbol <mcsymbol .Lpost_h>, debug-location64 65 ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp66 67 %2:gr64 = MOV64ri32 <mcsymbol .Lpre_f>68 %3:gr64 = MOV64ri32 <mcsymbol .Lpost_f>69 %4:gr64 = MOV64ri32 <mcsymbol .Lpre_g>70 %5:gr64 = MOV64ri32 <mcsymbol .Lpost_h>71 ; CHECK: %2:gr64 = MOV64ri32 <mcsymbol .Lpre_f>72 ; CHECK: %3:gr64 = MOV64ri32 <mcsymbol .Lpost_f>73 ; CHECK: %4:gr64 = MOV64ri32 <mcsymbol .Lpre_g>74 ; CHECK: %5:gr64 = MOV64ri32 <mcsymbol .Lpost_h>75 76 %6:gr64 = ADD64rr killed %2, killed %3, implicit-def $eflags77 %7:gr64 = ADD64rr killed %4, killed %5, implicit-def $eflags78 %8:gr64 = ADD64rr killed %6, killed %7, implicit-def $eflags79 $rax = COPY %880 RET64 implicit $rax81 82...83