brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 9240c1a Raw
76 lines · plain
1# RUN: llc -run-pass=mir-strip-debug -o - %s | FileCheck %s2# RUN: llc -run-pass=mir-strip-debug,mir-debugify,mir-strip-debug -o - %s | FileCheck %s3--- |4  ; ModuleID = 'loc-only.ll'5  source_filename = "loc-only.ll"6  7  define i32 @test(i32 %a, i32 %b) !dbg !6 {8    %add = add i32 %a, 2, !dbg !129    call void @llvm.dbg.value(metadata i32 %add, metadata !9, metadata !DIExpression()), !dbg !1210    %sub = sub i32 %add, %b, !dbg !1311    call void @llvm.dbg.value(metadata i32 %sub, metadata !11, metadata !DIExpression()), !dbg !1312    ret i32 %sub, !dbg !1413  }14  ; CHECK-LABEL: define i32 @test(i32 %a, i32 %b) {{(addrspace\([0-9]+\) )?}}{15  ; CHECK-NEXT:    %add = add i32 %a, 216  ; CHECK-NEXT:    %sub = sub i32 %add, %b17  ; CHECK-NEXT:    ret i32 %sub18  ; CHECK-NEXT:  }19  20  ; Function Attrs: nounwind readnone speculatable willreturn21  declare void @llvm.dbg.value(metadata, metadata, metadata) #022  23  ; Function Attrs: nounwind24  declare void @llvm.stackprotector(ptr, ptr) #125  26  attributes #0 = { nounwind readnone speculatable willreturn }27  attributes #1 = { nounwind }28  29  !llvm.dbg.cu = !{!0}30  ; CHECK-NOT: !llvm.dbg.cu31  !llvm.debugify = !{!3, !4}32  ; CHECK-NOT: !llvm.debugify33  !llvm.module.flags = !{!5, !15}34  ; CHECK: !llvm.module.flags = !{!0}35  ; CHECK: !0 = !{i32 2, !"Another Flag", i32 3}36  37  ; CHECK-NOT: !DI38  !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)39  !1 = !DIFile(filename: "<stdin>", directory: "/")40  !2 = !{}41  !3 = !{i32 3}42  !4 = !{i32 2}43  !5 = !{i32 2, !"Debug Info Version", i32 3}44  !6 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)45  !7 = !DISubroutineType(types: !2)46  !8 = !{!9, !11}47  !9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)48  !10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)49  !11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 2, type: !10)50  !12 = !DILocation(line: 1, column: 1, scope: !6)51  !13 = !DILocation(line: 2, column: 1, scope: !6)52  !14 = !DILocation(line: 3, column: 1, scope: !6)53  !15 = !{i32 2, !"Another Flag", i32 3}54 55...56---57name:            test58body:             |59  bb.1 (%ir-block.0):60    %0:_(s32) = G_IMPLICIT_DEF61    %1:_(s32) = G_IMPLICIT_DEF62    %2:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 0, scope: !6)63    %3:_(s32) = G_ADD %0, %2, debug-location !1264    DBG_VALUE %3(s32), $noreg, !9, !DIExpression(), debug-location !1265    %4:_(s32) = G_SUB %3, %1, debug-location !1366    DBG_VALUE %4(s32), $noreg, !11, !DIExpression(), debug-location !1367 68    ; CHECK-LABEL: body:69    ; CHECK-NEXT:    bb70    ; CHECK-NEXT:      %0:_(s32) = G_IMPLICIT_DEF{{$}}71    ; CHECK-NEXT:      %1:_(s32) = G_IMPLICIT_DEF{{$}}72    ; CHECK-NEXT:      %2:_(s32) = G_CONSTANT i32 2{{$}}73    ; CHECK-NEXT:      %3:_(s32) = G_ADD %0, %2{{$}}74    ; CHECK-NEXT:      %4:_(s32) = G_SUB %3, %1{{$}}75...76