blob: bb7efc3f7a28d16d309160b3f18e7418e9bccc5e [file] [log] [blame]
Reid Spencerd0e30dc2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2
Chris Lattnerf97c7f52006-03-04 09:35:02 +00002
3; This should have exactly 2 multiplies when we're done.
4
5int %f(int %a, int %b) {
6 %tmp.2 = mul int %a, %a
7 %tmp.5 = shl int %a, ubyte 1
8 %tmp.6 = mul int %tmp.5, %b
9 %tmp.10 = mul int %b, %b
10 %tmp.7 = add int %tmp.6, %tmp.2
11 %tmp.11 = add int %tmp.7, %tmp.10
12 ret int %tmp.11
13}
14