1 ; RUN: llvm-as < %s | opt -instcombine -disable-output &&
2 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep '(and\|xor\|add\|shl\|shr)'
5 %tmp.1 = and int %x, 65535 ; <int> [#uses=1]
6 %tmp.2 = xor int %tmp.1, -32768 ; <int> [#uses=1]
7 %tmp.3 = add int %tmp.2, 32768 ; <int> [#uses=1]
12 %tmp.1 = and int %x, 65535 ; <int> [#uses=1]
13 %tmp.2 = xor int %tmp.1, 32768 ; <int> [#uses=1]
14 %tmp.3 = add int %tmp.2, -32768 ; <int> [#uses=1]
18 int %test3(ushort %P) {
19 %tmp.1 = cast ushort %P to int ; <int> [#uses=1]
20 %tmp.4 = xor int %tmp.1, 32768 ; <int> [#uses=1]
21 %tmp.5 = add int %tmp.4, -32768 ; <int> [#uses=1]
25 uint %test4(ushort %P) {
26 %tmp.1 = cast ushort %P to uint ; <uint> [#uses=1]
27 %tmp.4 = xor uint %tmp.1, 32768 ; <uint> [#uses=1]
28 %tmp.5 = add uint %tmp.4, 4294934528 ; <uint> [#uses=1]
33 %tmp.1 = and int %x, 254
34 %tmp.2 = xor int %tmp.1, 128
35 %tmp.3 = add int %tmp.2, -128
40 %tmp.2 = shl int %x, ubyte 16 ; <int> [#uses=1]
41 %tmp.4 = shr int %tmp.2, ubyte 16 ; <int> [#uses=1]