test for a variety of new transformations:
[oota-llvm.git] / test / Transforms / InstCombine / rem.ll
1 ; This test makes sure that these instructions are properly eliminated.
2 ;
3
4 ; RUN: if as < %s | opt -instcombine | dis | grep rem
5 ; RUN: then exit 1
6 ; RUN: else exit 0
7 ; RUN: fi
8
9 implementation
10
11 int %test1(int %A) {
12         %B = rem int %A, 1    ; ISA constant 0
13         ret int %B
14 }
15
16 int %test2(int %A) {          ; 0 % X = 0, we don't need ot preserve traps
17         %B = rem int 0, %A
18         ret int %B
19 }
20
21 uint %test3(uint %A) {
22         %B = rem uint %A, 8   ; & 7
23         ret uint %B
24 }