brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · cb8d120 Raw
56 lines · plain
1; RUN: opt -S -passes=consthoist < %s | FileCheck %s2; ModuleID = 'test-hoist-debug.cpp'3source_filename = "test-hoist-debug.cpp"4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"5target triple = "x86_64-unknown-linux-gnu"6 7; Function Attrs: noinline nounwind optnone uwtable8define i32 @_Z3foov() !dbg !7 {9; CHECK: bitcast10; CHECK-NOT: !dbg !1111; CHECK: inttoptr12entry:13  %a0 = inttoptr i64 4646526064 to ptr14  %v0 = load i32, ptr %a0, align 16, !dbg !1115  %c = alloca i32, align 416  store i32 1, ptr %c, align 417  %0 = load i32, ptr %c, align 418  %cmp = icmp eq i32 %0, 019  br i1 %cmp, label %if.then, label %if.else20 21if.then:                                          ; preds = %entry22  %a1 = inttoptr i64 4646526080 to ptr23  %v1 = load i32, ptr %a1, align 16, !dbg !1124  br label %return25 26if.else:                                          ; preds = %entry27  %a2 = inttoptr i64 4646526096 to ptr28  %v2 = load i32, ptr %a2, align 16, !dbg !1129  br label %return30 31return:                                           ; preds = %if.else, %if.then32  %vx = phi i32 [%v1, %if.then], [%v2, %if.else]33  %r0 = add i32 %vx, %v034 35  ret i32 %r036}37 38!llvm.dbg.cu = !{!0}39!llvm.module.flags = !{!3, !4, !5}40!llvm.ident = !{!6}41 42!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)43!1 = !DIFile(filename: "test-hoist-debug.cpp", directory: "/tmp")44!2 = !{}45!3 = !{i32 2, !"Dwarf Version", i32 4}46!4 = !{i32 2, !"Debug Info Version", i32 3}47!5 = !{i32 1, !"wchar_size", i32 4}48!6 = !{!"clang version 6.0.0 (trunk 313291)"}49!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)50!8 = !DISubroutineType(types: !9)51!9 = !{!10}52!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)53!11 = !DILocation(line: 2, column: 3, scope: !7)54!12 = !DILocation(line: 3, column: 3, scope: !7)55!13 = !DILocation(line: 4, column: 3, scope: !7)56