Dehao Chen | 3656e30 | 2015-11-09 17:30:38 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -add-discriminators -S | FileCheck %s |
| 2 | |
| 3 | ; Discriminator support for calls that are defined in one line: |
| 4 | ; #1 void bar(); |
| 5 | ; #2 |
| 6 | ; #3 void foo() { |
| 7 | ; #4 bar();bar()/*discriminator 1*/;bar()/*discriminator 2*/; |
| 8 | ; #5 } |
| 9 | |
| 10 | ; Function Attrs: uwtable |
Pete Cooper | adebb93 | 2016-03-11 02:14:16 +0000 | [diff] [blame] | 11 | define void @_Z3foov() #0 !dbg !4 { |
Dehao Chen | 3656e30 | 2015-11-09 17:30:38 +0000 | [diff] [blame] | 12 | call void @_Z3barv(), !dbg !10 |
| 13 | ; CHECK: call void @_Z3barv(), !dbg ![[CALL0:[0-9]+]] |
| 14 | call void @_Z3barv(), !dbg !11 |
| 15 | ; CHECK: call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]] |
| 16 | call void @_Z3barv(), !dbg !12 |
| 17 | ; CHECK: call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]] |
| 18 | ret void, !dbg !13 |
| 19 | } |
| 20 | |
| 21 | declare void @_Z3barv() #1 |
| 22 | |
| 23 | attributes #0 = { uwtable "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 24 | attributes #1 = { "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 25 | |
Adrian Prantl | d1f52b67 | 2016-04-11 16:58:35 +0000 | [diff] [blame^] | 26 | !llvm.dbg.cu = !{!0} |
Dehao Chen | 3656e30 | 2015-11-09 17:30:38 +0000 | [diff] [blame] | 27 | !llvm.module.flags = !{!7, !8} |
| 28 | !llvm.ident = !{!9} |
| 29 | |
Adrian Prantl | d1f52b67 | 2016-04-11 16:58:35 +0000 | [diff] [blame^] | 30 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2, subprograms: !3) |
Dehao Chen | 3656e30 | 2015-11-09 17:30:38 +0000 | [diff] [blame] | 31 | !1 = !DIFile(filename: "c.cc", directory: "/tmp") |
| 32 | !2 = !{} |
| 33 | !3 = !{!4} |
| 34 | !4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) |
| 35 | !5 = !DISubroutineType(types: !6) |
| 36 | !6 = !{null} |
| 37 | !7 = !{i32 2, !"Dwarf Version", i32 4} |
| 38 | !8 = !{i32 2, !"Debug Info Version", i32 3} |
| 39 | !9 = !{!"clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)"} |
| 40 | !10 = !DILocation(line: 4, column: 3, scope: !4) |
| 41 | !11 = !DILocation(line: 4, column: 9, scope: !4) |
| 42 | !12 = !DILocation(line: 4, column: 15, scope: !4) |
| 43 | !13 = !DILocation(line: 5, column: 1, scope: !4) |
| 44 | |
| 45 | ; CHECK: ![[CALL1]] = !DILocation(line: 4, column: 9, scope: ![[CALL1BLOCK:[0-9]+]]) |
| 46 | ; CHECK: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 1) |
| 47 | ; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 15, scope: ![[CALL2BLOCK:[0-9]+]]) |
| 48 | ; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2) |