1 ; Simple sanity check testcase. Both alloca's should be eliminated.
2 ; RUN: opt < %s -debugify -mem2reg -check-debugify -S 2>&1 | FileCheck %s
5 ; CHECK: CheckModuleDebugify: PASS
7 define double @testfunc(i32 %i, double %j) {
8 %I = alloca i32 ; <i32*> [#uses=4]
9 %J = alloca double ; <double*> [#uses=2]
11 store double %j, double* %J
12 %t1 = load i32, i32* %I ; <i32> [#uses=1]
13 %t2 = add i32 %t1, 1 ; <i32> [#uses=1]
14 store i32 %t2, i32* %I
15 %t3 = load i32, i32* %I ; <i32> [#uses=1]
16 %t4 = sitofp i32 %t3 to double ; <double> [#uses=1]
17 %t5 = load double, double* %J ; <double> [#uses=1]
18 %t6 = fmul double %t4, %t5 ; <double> [#uses=1]