1; RUN: opt < %s -reassociate -instcombine -S | FileCheck %s
2
3; There should be exactly one shift and one add left.
4
5define i32 @test1(i32 %X, i32 %Y) {
6; CHECK-LABEL: @test1(
7; CHECK-NEXT:    [[REASS_ADD:%.*]] = add i32 %Y, %X
8; CHECK-NEXT:    [[REASS_MUL:%.*]] = shl i32 [[REASS_ADD]], 1
9; CHECK-NEXT:    ret i32 [[REASS_MUL]]
10;
11  %t2 = shl i32 %X, 1
12  %t6 = shl i32 %Y, 1
13  %t4 = add i32 %t6, %t2
14  ret i32 %t4
15}
16
17