1 ; RUN: opt < %s -passes=debugify,dse -S | FileCheck %s
2 ; RUN: opt < %s -passes=debugify,dse -S --try-experimental-debuginfo-iterators | FileCheck %s
4 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
6 declare noalias ptr @malloc(i32)
10 define ptr @test_salvage(i32 %arg) {
11 ; Check that all four original local variables have their values preserved.
12 ; CHECK-LABEL: @test_salvage(
14 ; CHECK-NEXT: #dbg_value(ptr %p, ![[p:.*]], !DIExpression(),
15 ; CHECK-NEXT: #dbg_value(i32 %arg, ![[DEAD:.*]], !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value),
16 ; CHECK-NEXT: call void @test_f()
17 ; CHECK-NEXT: store i32 0, ptr %p
19 %p = tail call ptr @malloc(i32 4)
20 %DEAD = add i32 %arg, 1
21 store i32 %DEAD, ptr %p
27 ; CHECK: ![[p]] = !DILocalVariable(name: "1"
28 ; CHECK: ![[DEAD]] = !DILocalVariable(name: "2"