aboutsummaryrefslogtreecommitdiff
path: root/test/DebugInfo/Mips
diff options
context:
space:
mode:
Diffstat (limited to 'test/DebugInfo/Mips')
-rw-r--r--test/DebugInfo/Mips/InlinedFnLocalVar.ll16
-rw-r--r--test/DebugInfo/Mips/delay-slot.ll12
-rw-r--r--test/DebugInfo/Mips/dsr-fixed-objects.ll156
-rw-r--r--test/DebugInfo/Mips/dsr-non-fixed-objects.ll125
-rw-r--r--test/DebugInfo/Mips/fn-call-line.ll6
-rw-r--r--test/DebugInfo/Mips/prologue_end.ll70
6 files changed, 368 insertions, 17 deletions
diff --git a/test/DebugInfo/Mips/InlinedFnLocalVar.ll b/test/DebugInfo/Mips/InlinedFnLocalVar.ll
index 2badeba2f579..fe661522da7c 100644
--- a/test/DebugInfo/Mips/InlinedFnLocalVar.ll
+++ b/test/DebugInfo/Mips/InlinedFnLocalVar.ll
@@ -12,7 +12,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
-define i32 @bar() nounwind ssp {
+define i32 @bar() nounwind ssp !dbg !6 {
entry:
%0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2]
tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19
@@ -25,20 +25,20 @@ entry:
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!28}
-!0 = !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)
+!0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)
!1 = !DIFile(filename: "bar.c", directory: "/tmp/")
-!2 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20)
+!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20)
!3 = !DISubroutineType(types: !4)
!4 = !{!5, !5}
!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar)
+!6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7)
!7 = !DISubroutineType(types: !8)
!8 = !{!5}
-!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5)
-!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12)
+!9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
+!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
-!59 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5)
-!60 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12)
+!59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)
+!60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)
!11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
diff --git a/test/DebugInfo/Mips/delay-slot.ll b/test/DebugInfo/Mips/delay-slot.ll
index df01775a12e6..e4cb9eac7cef 100644
--- a/test/DebugInfo/Mips/delay-slot.ll
+++ b/test/DebugInfo/Mips/delay-slot.ll
@@ -16,8 +16,8 @@
; FIXME: The next address probably ought to be 0x0000000000000004 but there's
; a constant initialization before the prologue's end.
; CHECK: 0x0000000000000008 2 0 1 0 0 is_stmt prologue_end
-; CHECK: 0x0000000000000028 3 0 1 0 0 is_stmt
-; CHECK: 0x0000000000000038 4 0 1 0 0 is_stmt
+; CHECK: 0x000000000000002c 3 0 1 0 0 is_stmt
+; CHECK: 0x000000000000003c 4 0 1 0 0 is_stmt
; CHECK: 0x0000000000000048 5 0 1 0 0 is_stmt
; CHECK: 0x0000000000000058 5 0 1 0 0 is_stmt end_sequence
@@ -26,7 +26,7 @@ target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
target triple = "mips--linux-gnu"
; Function Attrs: nounwind
-define i32 @foo(i32 %x) #0 {
+define i32 @foo(i32 %x) #0 !dbg !4 {
entry:
call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !12, metadata !DIExpression()), !dbg !13
%tobool = icmp ne i32 %x, 0, !dbg !14
@@ -56,11 +56,11 @@ attributes #1 = { nounwind readnone }
!llvm.module.flags = !{!9, !10}
!llvm.ident = !{!11}
-!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !DIFile(filename: "test.c", directory: "/tmp")
!2 = !{}
!3 = !{!4}
-!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2)
+!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
!5 = !DIFile(filename: "test.c", directory: "/tmp")
!6 = !DISubroutineType(types: !7)
!7 = !{!8, !8}
@@ -68,7 +68,7 @@ attributes #1 = { nounwind readnone }
!9 = !{i32 2, !"Dwarf Version", i32 4}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = !{!"clang version 3.5.0"}
-!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !4, file: !5, type: !8)
+!12 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !4, file: !5, type: !8)
!13 = !DILocation(line: 1, scope: !4)
!14 = !DILocation(line: 2, scope: !15)
!15 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4)
diff --git a/test/DebugInfo/Mips/dsr-fixed-objects.ll b/test/DebugInfo/Mips/dsr-fixed-objects.ll
new file mode 100644
index 000000000000..ee98272859a7
--- /dev/null
+++ b/test/DebugInfo/Mips/dsr-fixed-objects.ll
@@ -0,0 +1,156 @@
+; RUN: llc -march=mips -mcpu=mips32r2 -O1 -filetype=obj <%s | \
+; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F0
+; RUN: llc -march=mips -mcpu=mips32r2 -O1 -filetype=obj <%s | \
+; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F1
+
+; void foo(int *);
+;
+; int f0(int a, int b, int c, int d, int e) {
+; int x = a + b + c + d + e;
+; foo(&x);
+; return x;
+; }
+;
+; int f1(int a, int b, int c, int d, int e) {
+; int x __attribute__((aligned(16))) = a + b + c + d + e;
+; foo(&x);
+; return x;
+; }
+
+declare void @llvm.lifetime.start(i64, i8* nocapture)
+declare void @llvm.lifetime.end(i64, i8* nocapture)
+
+declare void @foo(i32*)
+
+; F0: DW_AT_location [DW_FORM_sec_offset] (0x00000014)
+; F0: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006b] = "x")
+;
+; x -> DW_OP_reg1(51)
+; F0: 0x00000014: Beginning address offset: 0x0000000000000028
+; F0: Ending address offset: 0x0000000000000030
+; F0: Location description: 51
+
+define i32 @f0(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e) !dbg !4 {
+entry:
+ %x = alloca i32, align 4
+ tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !9, metadata !DIExpression()), !dbg !27
+ tail call void @llvm.dbg.value(metadata i32 %b, i64 0, metadata !10, metadata !DIExpression()), !dbg !28
+ tail call void @llvm.dbg.value(metadata i32 %c, i64 0, metadata !11, metadata !DIExpression()), !dbg !29
+ tail call void @llvm.dbg.value(metadata i32 %d, i64 0, metadata !12, metadata !DIExpression()), !dbg !30
+ tail call void @llvm.dbg.value(metadata i32 %e, i64 0, metadata !13, metadata !DIExpression()), !dbg !31
+ %0 = bitcast i32* %x to i8*, !dbg !32
+ call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !32
+ %add = add nsw i32 %b, %a, !dbg !33
+ %add1 = add nsw i32 %add, %c, !dbg !34
+ %add2 = add nsw i32 %add1, %d, !dbg !35
+ %add3 = add nsw i32 %add2, %e, !dbg !36
+ tail call void @llvm.dbg.value(metadata i32 %add3, i64 0, metadata !14, metadata !DIExpression()), !dbg !37
+ store i32 %add3, i32* %x, align 4, !dbg !37, !tbaa !38
+ tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !14, metadata !26), !dbg !37
+ call void @foo(i32* nonnull %x) #4, !dbg !42
+ call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !14, metadata !26), !dbg !37
+ %1 = load i32, i32* %x, align 4, !dbg !43, !tbaa !38
+ call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !44
+ ret i32 %1, !dbg !45
+}
+
+
+; F1: DW_AT_location [DW_FORM_sec_offset] (0x00000033)
+; F1: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006b] = "x")
+
+; x -> DW_OP_reg1(51)
+; F1: 0x00000033: Beginning address offset: 0x0000000000000080
+; F1: Ending address offset: 0x0000000000000088
+; F1: Location description: 51
+
+define i32 @f1(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e) !dbg !15 {
+entry:
+ %x = alloca i32, align 16
+ tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !17, metadata !DIExpression()), !dbg !46
+ tail call void @llvm.dbg.value(metadata i32 %b, i64 0, metadata !18, metadata !DIExpression()), !dbg !47
+ tail call void @llvm.dbg.value(metadata i32 %c, i64 0, metadata !19, metadata !DIExpression()), !dbg !48
+ tail call void @llvm.dbg.value(metadata i32 %d, i64 0, metadata !20, metadata !DIExpression()), !dbg !49
+ tail call void @llvm.dbg.value(metadata i32 %e, i64 0, metadata !21, metadata !DIExpression()), !dbg !50
+ %0 = bitcast i32* %x to i8*, !dbg !51
+ call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !51
+ %add = add nsw i32 %b, %a, !dbg !52
+ %add1 = add nsw i32 %add, %c, !dbg !53
+ %add2 = add nsw i32 %add1, %d, !dbg !54
+ %add3 = add nsw i32 %add2, %e, !dbg !55
+ tail call void @llvm.dbg.value(metadata i32 %add3, i64 0, metadata !22, metadata !DIExpression()), !dbg !56
+ store i32 %add3, i32* %x, align 16, !dbg !56, !tbaa !38
+ tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !22, metadata !26), !dbg !56
+ call void @foo(i32* nonnull %x) #4, !dbg !57
+ call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !22, metadata !26), !dbg !56
+ %1 = load i32, i32* %x, align 16, !dbg !58, !tbaa !38
+ call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !59
+ ret i32 %1, !dbg !60
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!23, !24}
+!llvm.ident = !{!25}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
+!1 = !DIFile(filename: "test.c", directory: "/home/vk/repos/tmp/dwarf")
+!2 = !{}
+!3 = !{!4, !15}
+!4 = distinct !DISubprogram(name: "f0", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, variables: !8)
+!5 = !DISubroutineType(types: !6)
+!6 = !{!7, !7, !7, !7, !7, !7}
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !{!9, !10, !11, !12, !13, !14}
+!9 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 4, type: !7)
+!10 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 4, type: !7)
+!11 = !DILocalVariable(name: "c", arg: 3, scope: !4, file: !1, line: 4, type: !7)
+!12 = !DILocalVariable(name: "d", arg: 4, scope: !4, file: !1, line: 4, type: !7)
+!13 = !DILocalVariable(name: "e", arg: 5, scope: !4, file: !1, line: 4, type: !7)
+!14 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 5, type: !7)
+!15 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 11, type: !5, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, variables: !16)
+!16 = !{!17, !18, !19, !20, !21, !22}
+!17 = !DILocalVariable(name: "a", arg: 1, scope: !15, file: !1, line: 11, type: !7)
+!18 = !DILocalVariable(name: "b", arg: 2, scope: !15, file: !1, line: 11, type: !7)
+!19 = !DILocalVariable(name: "c", arg: 3, scope: !15, file: !1, line: 11, type: !7)
+!20 = !DILocalVariable(name: "d", arg: 4, scope: !15, file: !1, line: 11, type: !7)
+!21 = !DILocalVariable(name: "e", arg: 5, scope: !15, file: !1, line: 11, type: !7)
+!22 = !DILocalVariable(name: "x", scope: !15, file: !1, line: 12, type: !7)
+!23 = !{i32 2, !"Dwarf Version", i32 4}
+!24 = !{i32 2, !"Debug Info Version", i32 3}
+!25 = !{!"clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)"}
+!26 = !DIExpression(DW_OP_deref)
+!27 = !DILocation(line: 4, column: 12, scope: !4)
+!28 = !DILocation(line: 4, column: 19, scope: !4)
+!29 = !DILocation(line: 4, column: 26, scope: !4)
+!30 = !DILocation(line: 4, column: 33, scope: !4)
+!31 = !DILocation(line: 4, column: 40, scope: !4)
+!32 = !DILocation(line: 5, column: 3, scope: !4)
+!33 = !DILocation(line: 5, column: 13, scope: !4)
+!34 = !DILocation(line: 5, column: 17, scope: !4)
+!35 = !DILocation(line: 5, column: 21, scope: !4)
+!36 = !DILocation(line: 5, column: 25, scope: !4)
+!37 = !DILocation(line: 5, column: 7, scope: !4)
+!38 = !{!39, !39, i64 0}
+!39 = !{!"int", !40, i64 0}
+!40 = !{!"omnipotent char", !41, i64 0}
+!41 = !{!"Simple C/C++ TBAA"}
+!42 = !DILocation(line: 6, column: 3, scope: !4)
+!43 = !DILocation(line: 7, column: 10, scope: !4)
+!44 = !DILocation(line: 8, column: 1, scope: !4)
+!45 = !DILocation(line: 7, column: 3, scope: !4)
+!46 = !DILocation(line: 11, column: 12, scope: !15)
+!47 = !DILocation(line: 11, column: 19, scope: !15)
+!48 = !DILocation(line: 11, column: 26, scope: !15)
+!49 = !DILocation(line: 11, column: 33, scope: !15)
+!50 = !DILocation(line: 11, column: 40, scope: !15)
+!51 = !DILocation(line: 12, column: 3, scope: !15)
+!52 = !DILocation(line: 12, column: 42, scope: !15)
+!53 = !DILocation(line: 12, column: 46, scope: !15)
+!54 = !DILocation(line: 12, column: 50, scope: !15)
+!55 = !DILocation(line: 12, column: 54, scope: !15)
+!56 = !DILocation(line: 12, column: 7, scope: !15)
+!57 = !DILocation(line: 13, column: 3, scope: !15)
+!58 = !DILocation(line: 14, column: 10, scope: !15)
+!59 = !DILocation(line: 15, column: 1, scope: !15)
+!60 = !DILocation(line: 14, column: 3, scope: !15)
diff --git a/test/DebugInfo/Mips/dsr-non-fixed-objects.ll b/test/DebugInfo/Mips/dsr-non-fixed-objects.ll
new file mode 100644
index 000000000000..7bd68318ca51
--- /dev/null
+++ b/test/DebugInfo/Mips/dsr-non-fixed-objects.ll
@@ -0,0 +1,125 @@
+; RUN: llc -march=mips -mcpu=mips32r2 -O0 -filetype=obj <%s | \
+; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F2
+; RUN: llc -march=mips -mcpu=mips32r2 -O0 -filetype=obj <%s | \
+; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F3
+
+declare void @llvm.dbg.declare(metadata, metadata, metadata)
+
+declare void @foo(i32*)
+
+; void foo(int *);
+;
+; int f2(int a, int b) {
+; int c __attribute__((aligned(16))) = a + b;
+; foo(&c);
+; return c;
+; }
+;
+; int *f3(int a, int b) {
+; int c __attribute__((aligned(16))) = a + b;
+; int *w = alloca(c);
+; foo(&c);
+; return w;
+; }
+
+; c -> DW_OP_breg29(r29): 16
+; F2: DW_AT_location [DW_FORM_exprloc] (<0x2> 8d 10 )
+; F2: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000065] = "c")
+
+; Function Attrs: nounwind
+define i32 @f2(i32 signext %a, i32 signext %b) !dbg !4 {
+entry:
+ %a.addr = alloca i32, align 4
+ %b.addr = alloca i32, align 4
+ %c = alloca i32, align 16
+ store i32 %a, i32* %a.addr, align 4
+ call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !16), !dbg !17
+ store i32 %b, i32* %b.addr, align 4
+ call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !18, metadata !16), !dbg !19
+ call void @llvm.dbg.declare(metadata i32* %c, metadata !20, metadata !16), !dbg !21
+ %0 = load i32, i32* %a.addr, align 4, !dbg !22
+ %1 = load i32, i32* %b.addr, align 4, !dbg !23
+ %add = add nsw i32 %0, %1, !dbg !24
+ store i32 %add, i32* %c, align 16, !dbg !21
+ call void @foo(i32* %c), !dbg !25
+ %2 = load i32, i32* %c, align 16, !dbg !26
+ ret i32 %2, !dbg !27
+}
+
+; c -> DW_OP_breg23(r23): 16
+; F3: DW_AT_location [DW_FORM_exprloc] (<0x2> 87 10 )
+; F3: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000065] = "c")
+
+define i32* @f3(i32 signext %a, i32 signext %b) !dbg !8 {
+entry:
+ %a.addr = alloca i32, align 4
+ %b.addr = alloca i32, align 4
+ %c = alloca i32, align 16
+ %w = alloca i32*, align 4
+ store i32 %a, i32* %a.addr, align 4
+ call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !28, metadata !16), !dbg !29
+ store i32 %b, i32* %b.addr, align 4
+ call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !30, metadata !16), !dbg !31
+ call void @llvm.dbg.declare(metadata i32* %c, metadata !32, metadata !16), !dbg !33
+ %0 = load i32, i32* %a.addr, align 4, !dbg !34
+ %1 = load i32, i32* %b.addr, align 4, !dbg !35
+ %add = add nsw i32 %0, %1, !dbg !36
+ store i32 %add, i32* %c, align 16, !dbg !33
+ call void @llvm.dbg.declare(metadata i32** %w, metadata !37, metadata !16), !dbg !38
+ %2 = load i32, i32* %c, align 16, !dbg !39
+ %3 = alloca i8, i32 %2, !dbg !40
+ %4 = bitcast i8* %3 to i32*, !dbg !40
+ store i32* %4, i32** %w, align 4, !dbg !38
+ call void @foo(i32* %c), !dbg !41
+ %5 = load i32*, i32** %w, align 4, !dbg !42
+ ret i32* %5, !dbg !43
+}
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!12, !13}
+!llvm.ident = !{!14}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
+!1 = !DIFile(filename: "test.c", directory: "/home/vk/repos/tmp/dwarf")
+!2 = !{}
+!3 = !{!4, !8}
+!4 = distinct !DISubprogram(name: "f2", scope: !1, file: !1, line: 20, type: !5, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
+!5 = !DISubroutineType(types: !6)
+!6 = !{!7, !7, !7}
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = distinct !DISubprogram(name: "f3", scope: !1, file: !1, line: 27, type: !9, isLocal: false, isDefinition: true, scopeLine: 27, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!11, !7, !7}
+!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32)
+!12 = !{i32 2, !"Dwarf Version", i32 4}
+!13 = !{i32 2, !"Debug Info Version", i32 3}
+!14 = !{!"clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)"}
+!15 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 20, type: !7)
+!16 = !DIExpression()
+!17 = !DILocation(line: 20, column: 12, scope: !4)
+!18 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 20, type: !7)
+!19 = !DILocation(line: 20, column: 19, scope: !4)
+!20 = !DILocalVariable(name: "c", scope: !4, file: !1, line: 21, type: !7)
+!21 = !DILocation(line: 21, column: 7, scope: !4)
+!22 = !DILocation(line: 21, column: 40, scope: !4)
+!23 = !DILocation(line: 21, column: 44, scope: !4)
+!24 = !DILocation(line: 21, column: 42, scope: !4)
+!25 = !DILocation(line: 22, column: 3, scope: !4)
+!26 = !DILocation(line: 23, column: 10, scope: !4)
+!27 = !DILocation(line: 23, column: 3, scope: !4)
+!28 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 27, type: !7)
+!29 = !DILocation(line: 27, column: 13, scope: !8)
+!30 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !1, line: 27, type: !7)
+!31 = !DILocation(line: 27, column: 20, scope: !8)
+!32 = !DILocalVariable(name: "c", scope: !8, file: !1, line: 28, type: !7)
+!33 = !DILocation(line: 28, column: 7, scope: !8)
+!34 = !DILocation(line: 28, column: 40, scope: !8)
+!35 = !DILocation(line: 28, column: 44, scope: !8)
+!36 = !DILocation(line: 28, column: 42, scope: !8)
+!37 = !DILocalVariable(name: "w", scope: !8, file: !1, line: 29, type: !11)
+!38 = !DILocation(line: 29, column: 8, scope: !8)
+!39 = !DILocation(line: 29, column: 19, scope: !8)
+!40 = !DILocation(line: 29, column: 12, scope: !8)
+!41 = !DILocation(line: 30, column: 3, scope: !8)
+!42 = !DILocation(line: 31, column: 10, scope: !8)
+!43 = !DILocation(line: 31, column: 3, scope: !8)
diff --git a/test/DebugInfo/Mips/fn-call-line.ll b/test/DebugInfo/Mips/fn-call-line.ll
index 18ed3dfa43ad..a3130ce8c6eb 100644
--- a/test/DebugInfo/Mips/fn-call-line.ll
+++ b/test/DebugInfo/Mips/fn-call-line.ll
@@ -52,7 +52,7 @@
; Function Attrs: nounwind uwtable
-define void @f2() #0 {
+define void @f2() #0 !dbg !4 {
entry:
call void (...) @f1(), !dbg !11
call void (...) @f1(), !dbg !12
@@ -68,11 +68,11 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n
!llvm.module.flags = !{!8, !9}
!llvm.ident = !{!10}
-!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226641)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226641)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
!2 = !{}
!3 = !{!4}
-!4 = !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @f2, variables: !2)
+!4 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
!5 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
!6 = !DISubroutineType(types: !7)
!7 = !{null}
diff --git a/test/DebugInfo/Mips/prologue_end.ll b/test/DebugInfo/Mips/prologue_end.ll
new file mode 100644
index 000000000000..d93836d84983
--- /dev/null
+++ b/test/DebugInfo/Mips/prologue_end.ll
@@ -0,0 +1,70 @@
+; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC
+; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static -disable-fp-elim < %s | FileCheck %s -check-prefix=STATIC-FP
+; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC
+; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic -disable-fp-elim < %s | FileCheck %s -check-prefix=PIC-FP
+
+; Generated using clang -O0 -emit-llvm -S -target mipsel-unknown-linux -g test.c -o test.ll
+; test.c:
+;
+; void hello_world(void) {
+; printf("Hello, World!\n");
+; }
+
+@.str = private unnamed_addr constant [15 x i8] c"Hello, World!\0A\00", align 1
+
+define void @hello_world() #0 !dbg !4 {
+entry:
+; STATIC: addiu $sp, $sp, -{{[0-9]+}}
+; STATIC: sw $ra, {{[0-9]+}}($sp)
+; STATIC: .loc 1 2 3 prologue_end
+; STATIC: lui $[[R0:[0-9]+]], %hi($.str)
+
+; STATIC-FP: addiu $sp, $sp, -{{[0-9]+}}
+; STATIC-FP: sw $ra, {{[0-9]+}}($sp)
+; STATIC-FP: sw $fp, {{[0-9]+}}($sp)
+; STATIC-FP: move $fp, $sp
+; STATIC-FP: .loc 1 2 3 prologue_end
+; STATIC-FP: lui $[[R0:[0-9]+]], %hi($.str)
+
+; PIC: lui $[[R0:[0-9]+]], %hi(_gp_disp)
+; PIC: addiu $[[R0]], $[[R0]], %lo(_gp_disp)
+; PIC: addiu $sp, $sp, -{{[0-9]+}}
+; PIC: sw $ra, {{[0-9]+}}($sp)
+; PIC: addu $[[R1:[0-9]+]], $[[R0]], $25
+; PIC: .loc 1 2 3 prologue_end
+; PIC: lw $[[R2:[0-9]+]], %got($.str)($[[R1]])
+
+; PIC-FP: lui $[[R0:[0-9]+]], %hi(_gp_disp)
+; PIC-FP: addiu $[[R0]], $[[R0]], %lo(_gp_disp)
+; PIC-FP: addiu $sp, $sp, -{{[0-9]+}}
+; PIC-FP: sw $ra, {{[0-9]+}}($sp)
+; PIC-FP: sw $fp, {{[0-9]+}}($sp)
+; PIC-FP: move $fp, $sp
+; PIC-FP: addu $[[R1:[0-9]+]], $[[R0]], $25
+; PIC-FP: .loc 1 2 3 prologue_end
+; PIC-FP: lw $[[R2:[0-9]+]], %got($.str)($[[R1]])
+
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)), !dbg !10
+ ret void, !dbg !11
+}
+
+declare i32 @printf(i8*, ...)
+
+attributes #0 = { nounwind }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!7, !8}
+!llvm.ident = !{!9}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
+!1 = !DIFile(filename: "test.c", directory: "/tmp")
+!2 = !{}
+!3 = !{!4}
+!4 = distinct !DISubprogram(name: "hello_world", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2)
+!5 = !DISubroutineType(types: !6)
+!6 = !{null}
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 2, !"Debug Info Version", i32 3}
+!9 = !{!"clang version 3.8.0"}
+!10 = !DILocation(line: 2, column: 3, scope: !4)
+!11 = !DILocation(line: 3, column: 1, scope: !4)