1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep 'extsh\|rlwinm'
4 declare short @sext %foo()
6 int %test1(short @sext %X) {
7 %Y = cast short %X to int ;; dead
11 int %test2(ushort @zext %X) {
12 %Y = cast ushort %X to int
13 %Z = and int %Y, 65535 ;; dead
18 %tmp.0 = call short %foo() ;; no extsh!
19 %tmp.1 = setlt short %tmp.0, 1234
20 br bool %tmp.1, label %then, label %UnifiedReturnBlock
23 call int %test1(short 0)
29 uint %test4(ushort* %P) {
30 %tmp.1 = load ushort* %P
31 %tmp.2 = cast ushort %tmp.1 to uint
32 %tmp.3 = and uint %tmp.2, 255
36 uint %test5(short* %P) {
37 %tmp.1 = load short* %P
38 %tmp.2 = cast short %tmp.1 to ushort
39 %tmp.3 = cast ushort %tmp.2 to uint
40 %tmp.4 = and uint %tmp.3, 255
44 uint %test6(uint* %P) {
45 %tmp.1 = load uint* %P
46 %tmp.2 = and uint %tmp.1, 255
50 ushort @zext %test7(float %a) {
51 %tmp.1 = cast float %a to ushort