1 ; RUN: llc -mtriple=mips-linux-gnu -filetype=asm -asm-verbose=0 -O0 -relocation-model=pic < %s | FileCheck %s
2 ; RUN: llc -mtriple=mips-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-line - | FileCheck %s --check-prefix=INT
4 ; Mips used to generate 'jumpy' debug line info around calls. The address
5 ; calculation for each call to f1() would share the same line info so it would
6 ; emit output of the form:
7 ; .loc $first_call_location
8 ; .. address calculation ..
10 ; .. address calculation ..
11 ; .loc $second_call_location
13 ; .loc $first_call_location
14 ; .. address calculation ..
15 ; .loc $third_call_location
18 ; which would cause confusing stepping behaviour for the end user.
20 ; This test checks that we emit more user friendly debug line info of the form:
21 ; .loc $first_call_location
22 ; .. address calculation ..
24 ; .loc $second_call_location
25 ; .. address calculation ..
27 ; .loc $third_call_location
28 ; .. address calculation ..
32 ; Generated with clang from fn-call-line.c:
49 ; INT-NEXT: 2 0 1 0 0 is_stmt{{$}}
50 ; INT-NEXT: 3 3 1 0 0 is_stmt prologue_end{{$}}
51 ; INT-NEXT: 4 3 1 0 0 is_stmt{{$}}
54 ; Function Attrs: nounwind uwtable
55 define void @f2() #0 !dbg !4 {
57 call void (...) @f1(), !dbg !11
58 call void (...) @f1(), !dbg !12
62 declare void @f1(...) #1
64 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
65 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
68 !llvm.module.flags = !{!8, !9}
71 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226641)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
72 !1 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
74 !4 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2)
75 !5 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
76 !6 = !DISubroutineType(types: !7)
78 !8 = !{i32 2, !"Dwarf Version", i32 4}
79 !9 = !{i32 2, !"Debug Info Version", i32 3}
80 !10 = !{!"clang version 3.7.0 (trunk 226641)"}
81 !11 = !DILocation(line: 3, column: 3, scope: !4)
82 !12 = !DILocation(line: 4, column: 3, scope: !4)
83 !13 = !DILocation(line: 5, column: 1, scope: !4)