1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select
8 int %test1(int %A, int %B) {
9 %C = select bool false, int %A, int %B
13 int %test2(int %A, int %B) {
14 %C = select bool true, int %A, int %B
18 int %test3(bool %C, int %I) {
19 %V = select bool %C, int %I, int %I ; V = I
23 bool %test4(bool %C) {
24 %V = select bool %C, bool true, bool false ; V = C
28 bool %test5(bool %C) {
29 %V = select bool %C, bool false, bool true ; V = !C
34 %V = select bool %C, int 1, int 0 ; V = cast C to int
38 bool %test7(bool %C, bool %X) {
39 %R = select bool %C, bool true, bool %X ; R = or C, X
43 bool %test8(bool %C, bool %X) {
44 %R = select bool %C, bool %X, bool false ; R = and C, X
48 bool %test9(bool %C, bool %X) {
49 %R = select bool %C, bool false, bool %X ; R = and !C, X
53 bool %test10(bool %C, bool %X) {
54 %R = select bool %C, bool %X, bool true ; R = or !C, X