blob: 1018ca5b6e00df0c09270e89c4aad06084d91bd5 [file] [log] [blame]
Chris Lattner419bda12002-08-03 20:30:26 +00001; This test ensures that "strength reduction" of conditional expressions are
2; working. Basically this boils down to converting setlt,gt,le,ge instructions
3; into equivalent setne,eq instructions.
4;
5
6; RUN: if as < %s | opt -instcombine | dis | grep -v seteq | grep -v setne | grep set
7; RUN: then exit 1
8; RUN: else exit 0
9; RUN: fi
10
11bool "test1"(uint %A) {
12 %B = setge uint %A, 1 ; setne %A, 0
13 ret bool %B
14}
15
16bool "test2"(uint %A) {
17 %B = setgt uint %A, 0 ; setne %A, 0
18 ret bool %B
19}
20
21bool "test3"(sbyte %A) {
22 %B = setge sbyte %A, -127 ; setne %A, -128
23 ret bool %B
24}