; RUN: opt < %s -simplifycfg -S | FileCheck %s ; TODO: Track the acutal DebugLoc of the hoisted instruction when no-line ; DebugLoc is supported (https://reviews.llvm.org/D24180) ; Checks if the debug info for hoisted "x = i" is removed and ; the debug info for hoisted "bar()" is set as line 0 ; int x; ; void bar(); ; void baz(); ; ; void foo(int i) { ; if (i == 0) { ; x = i; ; bar(); ; } else { ; x = i; ; bar(); ; baz(); ; } ; } target triple = "x86_64-unknown-linux-gnu" @x = global i32 0, align 4 ; Function Attrs: uwtable define void @_Z3fooi(i32) #0 !dbg !6 { ; CHECK: load i32, i32* %2, align 4, !dbg ![[LOAD:[0-9]+]], !tbaa ; CHECK: store i32 %5, i32* @x, align 4, !dbg ![[BAR:[0-9]+]], !tbaa ; CHECK: call void @_Z3barv(), !dbg ![[BAR]] ; CHECK: call void @_Z3bazv(), !dbg ![[BAZ:[0-9]+]] %2 = alloca i32, align 4 store i32 %0, i32* %2, align 4, !tbaa !8 %3 = load i32, i32* %2, align 4, !dbg !12, !tbaa !8 %4 = icmp eq i32 %3, 0, !dbg !13 br i1 %4, label %5, label %7, !dbg !12 ;