llvm.org GIT mirror llvm / bf89553
Update for change in parameter attributes syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32923 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
1 changed file(s) with 32 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 &&
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep 'extsh\|rlwinm'
0 ; RUN: llvm-as < %s | llc -march=ppc32 &&
1 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep 'extsh\|rlwinm'
22
3 declare short @sext %foo()
3 declare i16 %foo() sext
44
5 int %test1(short @sext %X) {
6 %Y = cast short %X to int ;; dead
7 ret int %Y
5 define i32 %test1(i16 sext %X) {
6 %Y = sext i16 %X to i32 ;; dead
7 ret i32 %Y
88 }
99
10 int %test2(ushort @zext %X) {
11 %Y = cast ushort %X to int
12 %Z = and int %Y, 65535 ;; dead
13 ret int %Z
10 define i32 %test2(i16 zext %X) {
11 %Y = sext i16 %X to i32
12 %Z = and i32 %Y, 65535 ;; dead
13 ret i32 %Z
1414 }
1515
16 void %test3() {
17 %tmp.0 = call short %foo() ;; no extsh!
18 %tmp.1 = setlt short %tmp.0, 1234
16 define void %test3() {
17 %tmp.0 = call i16 %foo() sext ;; no extsh!
18 %tmp.1 = icmp slt i16 %tmp.0, 1234
1919 br bool %tmp.1, label %then, label %UnifiedReturnBlock
2020
2121 then:
22 call int %test1(short 0)
22 call i32 %test1(i16 0 sext)
2323 ret void
2424 UnifiedReturnBlock:
2525 ret void
2626 }
2727
28 uint %test4(ushort* %P) {
29 %tmp.1 = load ushort* %P
30 %tmp.2 = cast ushort %tmp.1 to uint
31 %tmp.3 = and uint %tmp.2, 255
32 ret uint %tmp.3
28 define i32 %test4(i16* %P) {
29 %tmp.1 = load i16* %P
30 %tmp.2 = zext i16 %tmp.1 to i32
31 %tmp.3 = and i32 %tmp.2, 255
32 ret i32 %tmp.3
3333 }
3434
35 uint %test5(short* %P) {
36 %tmp.1 = load short* %P
37 %tmp.2 = cast short %tmp.1 to ushort
38 %tmp.3 = cast ushort %tmp.2 to uint
39 %tmp.4 = and uint %tmp.3, 255
40 ret uint %tmp.4
35 define i32 %test5(i16* %P) {
36 %tmp.1 = load i16* %P
37 %tmp.2 = bitcast i16 %tmp.1 to i16
38 %tmp.3 = zext i16 %tmp.2 to i32
39 %tmp.4 = and i32 %tmp.3, 255
40 ret i32 %tmp.4
4141 }
4242
43 uint %test6(uint* %P) {
44 %tmp.1 = load uint* %P
45 %tmp.2 = and uint %tmp.1, 255
46 ret uint %tmp.2
43 define i32 %test6(i32* %P) {
44 %tmp.1 = load i32* %P
45 %tmp.2 = and i32 %tmp.1, 255
46 ret i32 %tmp.2
4747 }
4848
49 ushort @zext %test7(float %a) {
50 %tmp.1 = cast float %a to ushort
51 ret ushort %tmp.1
49 define i16 %test7(float %a) zext {
50 %tmp.1 = fptoui float %a to i16
51 ret i16 %tmp.1
5252 }