xref: /llvm-project/llvm/test/Transforms/AddDiscriminators/call.ll (revision fc655a9edf530bfe12764ebf92198ae5fef68091)
1cee313d2SEric Christopher; RUN: opt < %s -passes=add-discriminators -S | FileCheck %s
2cee313d2SEric Christopher
3cee313d2SEric Christopher; Discriminator support for calls that are defined in one line:
4cee313d2SEric Christopher; #1 void bar();
5cee313d2SEric Christopher; #2
6cee313d2SEric Christopher; #3 void foo() {
7cee313d2SEric Christopher; #4  bar();bar()/*discriminator 2*/;bar()/*discriminator 4*/;
8cee313d2SEric Christopher; #5 }
9cee313d2SEric Christopher
10cee313d2SEric Christopher; Function Attrs: uwtable
11cee313d2SEric Christopherdefine void @_Z3foov() #0 !dbg !4 {
12cee313d2SEric Christopher  call void @_Z3barv(), !dbg !10
13cee313d2SEric Christopher; CHECK:  call void @_Z3barv(), !dbg ![[CALL0:[0-9]+]]
14cee313d2SEric Christopher  %a = alloca [100 x i8], align 16
15*fc655a9eSNikita Popov  call void @llvm.lifetime.start.p0(i64 100, ptr %a), !dbg !11
16*fc655a9eSNikita Popov  call void @llvm.lifetime.end.p0(i64 100, ptr %a), !dbg !11
17cee313d2SEric Christopher  call void @_Z3barv(), !dbg !11
18cee313d2SEric Christopher; CHECK:  call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]]
19cee313d2SEric Christopher  call void @_Z3barv(), !dbg !12
20cee313d2SEric Christopher; CHECK:  call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]]
21cee313d2SEric Christopher  ret void, !dbg !13
22cee313d2SEric Christopher}
23cee313d2SEric Christopher
24cee313d2SEric Christopherdeclare void @_Z3barv() #1
25*fc655a9eSNikita Popovdeclare void @llvm.lifetime.start.p0(i64, ptr nocapture) nounwind argmemonly
26*fc655a9eSNikita Popovdeclare void @llvm.lifetime.end.p0(i64, ptr nocapture) nounwind argmemonly
27cee313d2SEric Christopher
284ab3041aSserge-sans-pailleattributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "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" }
294ab3041aSserge-sans-pailleattributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "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" }
30cee313d2SEric Christopher
31cee313d2SEric Christopher!llvm.dbg.cu = !{!0}
32cee313d2SEric Christopher!llvm.module.flags = !{!7, !8}
33cee313d2SEric Christopher!llvm.ident = !{!9}
34cee313d2SEric Christopher
35cee313d2SEric Christopher!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)
36cee313d2SEric Christopher!1 = !DIFile(filename: "c.cc", directory: "/tmp")
37cee313d2SEric Christopher!2 = !{}
38cee313d2SEric Christopher!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, unit: !0, retainedNodes: !2)
39cee313d2SEric Christopher!5 = !DISubroutineType(types: !6)
40cee313d2SEric Christopher!6 = !{null}
41cee313d2SEric Christopher!7 = !{i32 2, !"Dwarf Version", i32 4}
42cee313d2SEric Christopher!8 = !{i32 2, !"Debug Info Version", i32 3}
43cee313d2SEric Christopher!9 = !{!"clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)"}
44cee313d2SEric Christopher!10 = !DILocation(line: 4, column: 3, scope: !4)
45cee313d2SEric Christopher!11 = !DILocation(line: 4, column: 9, scope: !4)
46cee313d2SEric Christopher!12 = !DILocation(line: 4, column: 15, scope: !4)
47cee313d2SEric Christopher!13 = !DILocation(line: 5, column: 1, scope: !4)
48cee313d2SEric Christopher
49cee313d2SEric Christopher; CHECK: ![[CALL1]] = !DILocation(line: 4, column: 9, scope: ![[CALL1BLOCK:[0-9]+]])
50cee313d2SEric Christopher; CHECK: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2)
51cee313d2SEric Christopher; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 15, scope: ![[CALL2BLOCK:[0-9]+]])
52cee313d2SEric Christopher; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)
53