; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 ; RUN: opt < %s -p=simplifycfg -S | FileCheck %s ;; Test that when we replace the invoke of @baz with a call and branch to the ;; invoke destination, we propagate the source location of the invoke to both ;; the call and the branch. target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define void @widget(i1 %arg) personality ptr null !dbg !5 { ; CHECK-LABEL: define void @widget( ; CHECK-SAME: i1 [[ARG:%.*]]) personality ptr null !dbg [[DBG5:![0-9]+]] { ; CHECK-NEXT: [[BB:.*:]] ; CHECK-NEXT: br i1 [[ARG]], label %[[BB2:.*]], label %[[BB1:.*]] ; CHECK: [[BB1]]: ; CHECK-NEXT: call void @baz(ptr null) #[[ATTR0:[0-9]+]], !dbg [[DBG8:![0-9]+]] ; CHECK-NEXT: br label %[[BB2]], !dbg [[DBG8]] ; CHECK: [[BB2]]: ; CHECK-NEXT: ret void ; bb: br i1 %arg, label %bb2, label %bb1 bb1: ; preds = %bb invoke void @baz(ptr null) to label %bb2 unwind label %bb3, !dbg !8 bb2: ; preds = %bb1, %bb ret void bb3: ; preds = %bb1 %landingpad = landingpad { ptr, i32 } cleanup store i1 false, ptr null, align 1 ret void } declare void @baz(ptr) !llvm.dbg.cu = !{!0} !llvm.debugify = !{!2, !3} !llvm.module.flags = !{!4} !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) !1 = !DIFile(filename: "debugloc-invoke-to-call-br.ll", directory: "/") !2 = !{i32 6} !3 = !{i32 0} !4 = !{i32 2, !"Debug Info Version", i32 3} !5 = distinct !DISubprogram(name: "widget", linkageName: "widget", scope: null, file: !1, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0) !6 = !DISubroutineType(types: !7) !7 = !{} !8 = !DILocation(line: 1, column: 1, scope: !5) ;. ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: [[META1:![0-9]+]], producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) ; CHECK: [[META1]] = !DIFile(filename: "debugloc-invoke-to-call-br.ll", directory: {{.*}}) ; CHECK: [[DBG5]] = distinct !DISubprogram(name: "widget", linkageName: "widget", scope: null, file: [[META1]], line: 1, type: [[META6:![0-9]+]], scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]]) ; CHECK: [[META6]] = !DISubroutineType(types: [[META7:![0-9]+]]) ; CHECK: [[META7]] = !{} ; CHECK: [[DBG8]] = !DILocation(line: 1, column: 1, scope: [[DBG5]]) ;.