[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Transforms / AddDiscriminators / call.ll
blob23bdf03ddb37154d43253f3f0bb9a34122ce00b0
1 ; RUN: opt < %s -passes=add-discriminators -S | FileCheck %s
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 2*/;bar()/*discriminator 4*/;
8 ; #5 }
10 ; Function Attrs: uwtable
11 define void @_Z3foov() #0 !dbg !4 {
12   call void @_Z3barv(), !dbg !10
13 ; CHECK:  call void @_Z3barv(), !dbg ![[CALL0:[0-9]+]]
14   %a = alloca [100 x i8], align 16
15   %b = bitcast [100 x i8]* %a to i8*
16   call void @llvm.lifetime.start.p0i8(i64 100, i8* %b), !dbg !11
17   call void @llvm.lifetime.end.p0i8(i64 100, i8* %b), !dbg !11
18   call void @_Z3barv(), !dbg !11
19 ; CHECK:  call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]]
20   call void @_Z3barv(), !dbg !12
21 ; CHECK:  call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]]
22   ret void, !dbg !13
25 declare void @_Z3barv() #1
26 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind argmemonly
27 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) nounwind argmemonly
29 attributes #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" }
30 attributes #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" }
32 !llvm.dbg.cu = !{!0}
33 !llvm.module.flags = !{!7, !8}
34 !llvm.ident = !{!9}
36 !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)
37 !1 = !DIFile(filename: "c.cc", directory: "/tmp")
38 !2 = !{}
39 !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)
40 !5 = !DISubroutineType(types: !6)
41 !6 = !{null}
42 !7 = !{i32 2, !"Dwarf Version", i32 4}
43 !8 = !{i32 2, !"Debug Info Version", i32 3}
44 !9 = !{!"clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)"}
45 !10 = !DILocation(line: 4, column: 3, scope: !4)
46 !11 = !DILocation(line: 4, column: 9, scope: !4)
47 !12 = !DILocation(line: 4, column: 15, scope: !4)
48 !13 = !DILocation(line: 5, column: 1, scope: !4)
50 ; CHECK: ![[CALL1]] = !DILocation(line: 4, column: 9, scope: ![[CALL1BLOCK:[0-9]+]])
51 ; CHECK: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2)
52 ; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 15, scope: ![[CALL2BLOCK:[0-9]+]])
53 ; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)