4141c10d70521220a8f4d27e6059ac03ad67182f
[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: echo foo
4 ; RUN: if as < %s | opt -instcombine | dis | grep add
5 ; RUN: then exit 1
6 ; RUN: else exit 0
7 ; RUN: fi
8 ;
9
10
11 int "test"(int %i, int %j) {
12         %A = mul int %i, %j
13         %B = sub int 2, %A
14         ret int %B
15 }