87 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 !4 {8 %add = add i32 %a, 2, !dbg !109 call void @llvm.dbg.value(metadata i32 %add, metadata !7, metadata !DIExpression()), !dbg !1010 %sub = sub i32 %add, %b, !dbg !1111 call void @llvm.dbg.value(metadata i32 %sub, metadata !9, metadata !DIExpression()), !dbg !1112 ret i32 %sub, !dbg !1213 }14 ; CHECK-LABEL: define i32 @test(i32 %a, i32 %b) {{(addrspace\([0-9]+\) )?}}!dbg !4 {15 ; CHECK-NEXT: %add = add i32 %a, 2, !dbg !1016 ; CHECK-NEXT: #dbg_value(i32 %add, !7, !DIExpression(), !1017 ; CHECK-NEXT: %sub = sub i32 %add, %b, !dbg !1118 ; CHECK-NEXT: #dbg_value(i32 %sub, !9, !DIExpression(), !1119 ; CHECK-NEXT: ret i32 %sub, !dbg !1220 ; CHECK-NEXT: }21 22 ; Function Attrs: nounwind readnone speculatable willreturn23 declare void @llvm.dbg.value(metadata, metadata, metadata) #024 25 ; Function Attrs: nounwind26 declare void @llvm.stackprotector(ptr, ptr) #127 28 attributes #0 = { nounwind readnone speculatable willreturn }29 attributes #1 = { nounwind }30 31 !llvm.dbg.cu = !{!0}32 ; CHECK: !llvm.dbg.cu = !{!0}33 !llvm.module.flags = !{!3}34 ; CHECK: !llvm.module.flags = !{!3}35 36 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)37 !1 = !DIFile(filename: "<stdin>", directory: "/")38 !2 = !{}39 !3 = !{i32 2, !"Debug Info Version", i32 3}40 !4 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6)41 !5 = !DISubroutineType(types: !2)42 !6 = !{!7, !9}43 !7 = !DILocalVariable(name: "1", scope: !4, file: !1, line: 1, type: !8)44 !8 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)45 !9 = !DILocalVariable(name: "2", scope: !4, file: !1, line: 2, type: !8)46 !10 = !DILocation(line: 1, column: 1, scope: !4)47 !11 = !DILocation(line: 2, column: 1, scope: !4)48 !12 = !DILocation(line: 3, column: 1, scope: !4)49 50 ; CHECK: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)51 ; CHECK: !1 = !DIFile(filename: "<stdin>", directory: "/")52 ; CHECK: !2 = !{}53 ; CHECK: !3 = !{i32 2, !"Debug Info Version", i32 3}54 ; CHECK: !4 = distinct !DISubprogram(name: "test", linkageName: "test", scope: null, file: !1, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !6)55 ; CHECK: !5 = !DISubroutineType(types: !2)56 ; CHECK: !6 = !{!7, !9}57 ; CHECK: !7 = !DILocalVariable(name: "1", scope: !4, file: !1, line: 1, type: !8)58 ; CHECK: !8 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)59 ; CHECK: !9 = !DILocalVariable(name: "2", scope: !4, file: !1, line: 2, type: !8)60 ; CHECK: !10 = !DILocation(line: 1, column: 1, scope: !4)61 ; CHECK: !11 = !DILocation(line: 2, column: 1, scope: !4)62 ; CHECK: !12 = !DILocation(line: 3, column: 1, scope: !4)63 64...65---66name: test67body: |68 bb.1 (%ir-block.0):69 %0:_(s32) = G_IMPLICIT_DEF70 %1:_(s32) = G_IMPLICIT_DEF71 %2:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 0, scope: !4)72 %3:_(s32) = G_ADD %0, %2, debug-location !1073 DBG_VALUE %3(s32), $noreg, !7, !DIExpression(), debug-location !1074 %4:_(s32) = G_SUB %3, %1, debug-location !1175 DBG_VALUE %4(s32), $noreg, !9, !DIExpression(), debug-location !1176 77 ; CHECK-LABEL: body:78 ; CHECK-NEXT: bb79 ; CHECK-NEXT: %0:_(s32) = G_IMPLICIT_DEF{{$}}80 ; CHECK-NEXT: %1:_(s32) = G_IMPLICIT_DEF{{$}}81 ; CHECK-NEXT: %2:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 0, scope: !4)82 ; CHECK-NEXT: %3:_(s32) = G_ADD %0, %2, debug-location !1083 ; CHECK-NEXT: DBG_VALUE %3(s32), $noreg, !7, !DIExpression(), debug-location !1084 ; CHECK-NEXT: %4:_(s32) = G_SUB %3, %1, debug-location !1185 ; CHECK-NEXT: DBG_VALUE %4(s32), $noreg, !9, !DIExpression(), debug-location !1186...87