New testcase for bug
[oota-llvm.git] / test / Transforms / InstCombine / 2002-05-14-SubFailure.ll
1 ; Instcombine was missing a test that caused it to make illegal transformations
2 ; sometimes.  In this case, it transforms the sub into an add:
3 ; RUN: if as < %s | opt -instcombine | dis | grep add
4 ; RUN: then exit 1
5 ; RUN: else exit 0
6 ; RUN: fi
7 ;
8
9
10 int "test"(int %i, int %j) {
11         %A = mul int %i, %j
12         %B = sub int 2, %A
13         ret int %B
14 }