xref: /llvm-project/llvm/test/Transforms/ConstantHoisting/X86/dbg-samebasicblock.ll (revision 055fb7795aa219a3d274d280ec9129784f169f56)
133b939c3SRoman Lebedev; RUN: opt -S -passes=consthoist < %s | FileCheck %s
2cee313d2SEric Christopher; ModuleID = 'test-hoist-debug.cpp'
3cee313d2SEric Christophersource_filename = "test-hoist-debug.cpp"
4cee313d2SEric Christophertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5cee313d2SEric Christophertarget triple = "x86_64-unknown-linux-gnu"
6cee313d2SEric Christopher
7cee313d2SEric Christopher; Function Attrs: noinline nounwind optnone uwtable
8cee313d2SEric Christopherdefine i32 @_Z3foov() !dbg !7 {
9cee313d2SEric Christopher; CHECK: bitcast
10cee313d2SEric Christopher; CHECK: !dbg !11
11cee313d2SEric Christopher; CHECK: inttoptr
12*055fb779SNikita Popov  %a0 = inttoptr i64 4646526064 to ptr, !dbg !11
13*055fb779SNikita Popov  %v0 = load i32, ptr %a0, align 16, !dbg !11
14cee313d2SEric Christopher
15*055fb779SNikita Popov  %a1 = inttoptr i64 4646526080 to ptr
16*055fb779SNikita Popov  %v1 = load i32, ptr %a1, align 16, !dbg !11
17cee313d2SEric Christopher
18*055fb779SNikita Popov  %a2 = inttoptr i64 4646526096 to ptr
19*055fb779SNikita Popov  %v2 = load i32, ptr %a2, align 16, !dbg !11
20cee313d2SEric Christopher
21cee313d2SEric Christopher  %r0 = add i32 %v0, %v1
22cee313d2SEric Christopher  %r1 = add i32 %r0, %v2
23cee313d2SEric Christopher  ret i32 %r1
24cee313d2SEric Christopher}
25cee313d2SEric Christopher
26cee313d2SEric Christopher!llvm.dbg.cu = !{!0}
27cee313d2SEric Christopher!llvm.module.flags = !{!3, !4, !5}
28cee313d2SEric Christopher!llvm.ident = !{!6}
29cee313d2SEric Christopher
30cee313d2SEric Christopher!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 313291)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
31cee313d2SEric Christopher!1 = !DIFile(filename: "test-hoist-debug.cpp", directory: "/tmp")
32cee313d2SEric Christopher!2 = !{}
33cee313d2SEric Christopher!3 = !{i32 2, !"Dwarf Version", i32 4}
34cee313d2SEric Christopher!4 = !{i32 2, !"Debug Info Version", i32 3}
35cee313d2SEric Christopher!5 = !{i32 1, !"wchar_size", i32 4}
36cee313d2SEric Christopher!6 = !{!"clang version 6.0.0 (trunk 313291)"}
37cee313d2SEric Christopher!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
38cee313d2SEric Christopher!8 = !DISubroutineType(types: !9)
39cee313d2SEric Christopher!9 = !{!10}
40cee313d2SEric Christopher!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
41cee313d2SEric Christopher!11 = !DILocation(line: 2, column: 3, scope: !7)
42