[opaque pointer type] Add textual IR support for explicit type parameter to the call...
[oota-llvm.git] / test / DebugInfo / Mips / fn-call-line.ll
1 ; RUN: llc -mtriple=mips-linux-gnu -filetype=asm -asm-verbose=0 -O0 < %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
55 define void @f2() #0 {
56 entry:
57   call void (...) @f1(), !dbg !11
58   call void (...) @f1(), !dbg !12
59   ret void, !dbg !13
60 }
61
62 declare void @f1(...) #1
63
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" }
66
67 !llvm.dbg.cu = !{!0}
68 !llvm.module.flags = !{!8, !9}
69 !llvm.ident = !{!10}
70
71 !0 = !MDCompileUnit(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)
72 !1 = !MDFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
73 !2 = !{}
74 !3 = !{!4}
75 !4 = !MDSubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @f2, variables: !2)
76 !5 = !MDFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo")
77 !6 = !MDSubroutineType(types: !7)
78 !7 = !{null}
79 !8 = !{i32 2, !"Dwarf Version", i32 4}
80 !9 = !{i32 2, !"Debug Info Version", i32 3}
81 !10 = !{!"clang version 3.7.0 (trunk 226641)"}
82 !11 = !MDLocation(line: 3, column: 3, scope: !4)
83 !12 = !MDLocation(line: 4, column: 3, scope: !4)
84 !13 = !MDLocation(line: 5, column: 1, scope: !4)