blob: b84d3d9fc208286fe06f23da9caca6232670a566 [file] [log] [blame]
Chris Lattnerc714f262006-03-14 06:54:32 +00001; There should be exactly one shift and one add left.
Tanya Lattner0ea4c8d2008-03-19 04:36:04 +00002; RUN: llvm-as < %s | \
Dan Gohman72a13d22009-09-08 22:34:10 +00003; RUN: opt -reassociate -instcombine -S > %t
Dan Gohmanf9dd1702007-08-15 13:36:28 +00004; RUN: grep shl %t | count 1
5; RUN: grep add %t | count 1
Chris Lattnerc714f262006-03-14 06:54:32 +00006
Tanya Lattner0ea4c8d2008-03-19 04:36:04 +00007define i32 @test(i32 %X, i32 %Y) {
8 %tmp.2 = shl i32 %X, 1 ; <i32> [#uses=1]
9 %tmp.6 = shl i32 %Y, 1 ; <i32> [#uses=1]
10 %tmp.4 = add i32 %tmp.6, %tmp.2 ; <i32> [#uses=1]
11 ret i32 %tmp.4
Chris Lattnerc714f262006-03-14 06:54:32 +000012}
13