| 1 |
; RUN: opt -S -passes=consthoist < %s | FileCheck %s |
| 2 |
; ModuleID = 'test-hoist-debug.cpp' |
| 3 |
source_filename = "test-hoist-debug.cpp" |
| 4 |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 5 |
target triple = "x86_64-unknown-linux-gnu" |
| 6 |
|
| 7 |
; Function Attrs: noinline nounwind optnone uwtable |
| 8 |
define i32 @_Z3foov() !dbg !7 { |
| 9 |
; CHECK: bitcast |
| 10 |
; CHECK: !dbg !11 |
| 11 |
; CHECK: inttoptr |
| 12 |
%a0 = inttoptr i64 4646526064 to ptr, !dbg !11 |
| 13 |
%v0 = load i32, ptr %a0, align 16, !dbg !11 |
| 14 |
|
| 15 |
%a1 = inttoptr i64 4646526080 to ptr |
| 16 |
%v1 = load i32, ptr %a1, align 16, !dbg !11 |
| 17 |
|
| 18 |
%a2 = inttoptr i64 4646526096 to ptr |
| 19 |
%v2 = load i32, ptr %a2, align 16, !dbg !11 |
| 20 |
|
| 21 |
%r0 = add i32 %v0, %v1 |
| 22 |
%r1 = add i32 %r0, %v2 |
| 23 |
ret i32 %r1 |
| 24 |
} |
| 25 |
|
| 26 |
!llvm.dbg.cu = !{!0} |
| 27 |
!llvm.module.flags = !{!3, !4, !5} |
| 28 |
!llvm.ident = !{!6} |
| 29 |
|
| 30 |
!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) |
| 31 |
!1 = !DIFile(filename: "test-hoist-debug.cpp", directory: "/tmp") |
| 32 |
!2 = !{} |
| 33 |
!3 = !{i32 2, !"Dwarf Version", i32 4} |
| 34 |
!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 35 |
!5 = !{i32 1, !"wchar_size", i32 4} |
| 36 |
!6 = !{!"clang version 6.0.0 (trunk 313291)"} |
| 37 |
!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) |
| 38 |
!8 = !DISubroutineType(types: !9) |
| 39 |
!9 = !{!10} |
| 40 |
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 41 |
!11 = !DILocation(line: 2, column: 3, scope: !7) |