xref: /llvm-project/llvm/test/Transforms/AddDiscriminators/call-nested.ll (revision 3f8027fb67bc4efae9959a4d75f8f37ecf0c3985)
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 int foo(int, int);
5cee313d2SEric Christopher; #2 int bar();
6cee313d2SEric Christopher; #3 int baz() {
7cee313d2SEric Christopher; #4   return foo(bar(),
8cee313d2SEric Christopher; #5              bar());
9cee313d2SEric Christopher; #6 }
10cee313d2SEric Christopher
11cee313d2SEric Christopher; Function Attrs: uwtable
12cee313d2SEric Christopherdefine i32 @_Z3bazv() #0 !dbg !4 {
13cee313d2SEric Christopher  %1 = call i32 @_Z3barv(), !dbg !11
14cee313d2SEric Christopher; CHECK: %1 = call i32 @_Z3barv(), !dbg ![[CALL0:[0-9]+]]
15cee313d2SEric Christopher  %2 = call i32 @_Z3barv(), !dbg !12
16cee313d2SEric Christopher; CHECK: %2 = call i32 @_Z3barv(), !dbg ![[CALL1:[0-9]+]]
17cee313d2SEric Christopher  %3 = call i32 @_Z3fooii(i32 %1, i32 %2), !dbg !13
18cee313d2SEric Christopher; CHECK: %3 = call i32 @_Z3fooii(i32 %1, i32 %2), !dbg ![[CALL2:[0-9]+]]
19cee313d2SEric Christopher  ret i32 %3, !dbg !14
20cee313d2SEric Christopher}
21cee313d2SEric Christopher
22cee313d2SEric Christopherdeclare i32 @_Z3fooii(i32, i32) #1
23cee313d2SEric Christopher
24cee313d2SEric Christopherdeclare i32 @_Z3barv() #1
25cee313d2SEric Christopher
26*4ab3041aSserge-sans-pailleattributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
27*4ab3041aSserge-sans-pailleattributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
28cee313d2SEric Christopher
29cee313d2SEric Christopher!llvm.dbg.cu = !{!0}
30cee313d2SEric Christopher!llvm.module.flags = !{!8, !9}
31cee313d2SEric Christopher!llvm.ident = !{!10}
32cee313d2SEric Christopher
33cee313d2SEric Christopher!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 266269)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
34cee313d2SEric Christopher!1 = !DIFile(filename: "test.cc", directory: "")
35cee313d2SEric Christopher!2 = !{}
36cee313d2SEric Christopher!4 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
37cee313d2SEric Christopher!5 = !DISubroutineType(types: !6)
38cee313d2SEric Christopher!6 = !{!7}
39cee313d2SEric Christopher!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
40cee313d2SEric Christopher!8 = !{i32 2, !"Dwarf Version", i32 4}
41cee313d2SEric Christopher!9 = !{i32 2, !"Debug Info Version", i32 3}
42cee313d2SEric Christopher!10 = !{!"clang version 3.9.0 (trunk 266269)"}
43cee313d2SEric Christopher!11 = !DILocation(line: 4, column: 14, scope: !4)
44cee313d2SEric Christopher!12 = !DILocation(line: 5, column: 14, scope: !4)
45cee313d2SEric Christopher!13 = !DILocation(line: 4, column: 10, scope: !4)
46cee313d2SEric Christopher!14 = !DILocation(line: 4, column: 3, scope: !4)
47cee313d2SEric Christopher
48cee313d2SEric Christopher; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 10, scope: ![[CALL2BLOCK:[0-9]+]])
49cee313d2SEric Christopher; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2)
50