• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-dump=line - | FileCheck %s --check-prefix=INT
3
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 ..
9;   .. function call ..
10;   .. address calculation ..
11;   .loc $second_call_location
12;   .. function call ..
13;   .loc $first_call_location
14;   .. address calculation ..
15;   .loc $third_call_location
16;   .. function call ..
17;   ...
18; which would cause confusing stepping behaviour for the end user.
19;
20; This test checks that we emit more user friendly debug line info of the form:
21;   .loc $first_call_location
22;   .. address calculation ..
23;   .. function call ..
24;   .loc $second_call_location
25;   .. address calculation ..
26;   .. function call ..
27;   .loc $third_call_location
28;   .. address calculation ..
29;   .. function call ..
30;   ...
31;
32; Generated with clang from fn-call-line.c:
33; void f1();
34; void f2() {
35;   f1();
36;   f1();
37; }
38
39; CHECK: .loc	1 3 3
40; CHECK-NOT: .loc
41; CHECK: %call16(f1)
42; CHECK-NOT: .loc
43; CHECK: .loc	1 4 3
44; CHECK-NOT: .loc
45; CHECK: %call16(f1)
46
47; INT: {{^}}Address
48; INT: -----
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{{$}}
52
53
54; Function Attrs: nounwind uwtable
55define void @f2() #0 !dbg !4 {
56entry:
57  call void (...) @f1(), !dbg !11
58  call void (...) @f1(), !dbg !12
59  ret void, !dbg !13
60}
61
62declare void @f1(...) #1
63
64attributes #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" }
65attributes #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" }
66
67!llvm.dbg.cu = !{!0}
68!llvm.module.flags = !{!8, !9}
69!llvm.ident = !{!10}
70
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")
73!2 = !{}
74!4 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
75!5 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
76!6 = !DISubroutineType(types: !7)
77!7 = !{null}
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)
84