llvm.org GIT mirror llvm / 50d0705
Tests for 91103 and 91104. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91105 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 10 years ago
1 changed file(s) with 93 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -asm-verbose=false | FileCheck %s -check-prefix=32BIT
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -asm-verbose=false | FileCheck %s -check-prefix=64BIT
2
3 define zeroext i16 @t1(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
4 entry:
5 ; 32BIT: t1:
6 ; 32BIT: movw 20(%esp), %ax
7 ; 32BIT-NOT: movw %ax, %cx
8 ; 32BIT: leal 1(%eax), %ecx
9
10 ; 64BIT: t1:
11 ; 64BIT-NOT: movw %si, %ax
12 ; 64BIT: leal 1(%rsi), %eax
13 %0 = icmp eq i16 %k, %c ; [#uses=1]
14 %1 = add i16 %k, 1 ; [#uses=3]
15 br i1 %0, label %bb, label %bb1
16
17 bb: ; preds = %entry
18 tail call void @foo(i16 zeroext %1) nounwind
19 ret i16 %1
20
21 bb1: ; preds = %entry
22 ret i16 %1
23 }
24
25 define zeroext i16 @t2(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
26 entry:
27 ; 32BIT: t2:
28 ; 32BIT: movw 20(%esp), %ax
29 ; 32BIT-NOT: movw %ax, %cx
30 ; 32BIT: leal -1(%eax), %ecx
31
32 ; 64BIT: t2:
33 ; 64BIT-NOT: movw %si, %ax
34 ; 64BIT: leal -1(%rsi), %eax
35 %0 = icmp eq i16 %k, %c ; [#uses=1]
36 %1 = add i16 %k, -1 ; [#uses=3]
37 br i1 %0, label %bb, label %bb1
38
39 bb: ; preds = %entry
40 tail call void @foo(i16 zeroext %1) nounwind
41 ret i16 %1
42
43 bb1: ; preds = %entry
44 ret i16 %1
45 }
46
47 declare void @foo(i16 zeroext)
48
49 define zeroext i16 @t3(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
50 entry:
51 ; 32BIT: t3:
52 ; 32BIT: movw 20(%esp), %ax
53 ; 32BIT-NOT: movw %ax, %cx
54 ; 32BIT: leal 2(%eax), %ecx
55
56 ; 64BIT: t3:
57 ; 64BIT-NOT: movw %si, %ax
58 ; 64BIT: leal 2(%rsi), %eax
59 %0 = add i16 %k, 2 ; [#uses=3]
60 %1 = icmp eq i16 %k, %c ; [#uses=1]
61 br i1 %1, label %bb, label %bb1
62
63 bb: ; preds = %entry
64 tail call void @foo(i16 zeroext %0) nounwind
65 ret i16 %0
66
67 bb1: ; preds = %entry
68 ret i16 %0
69 }
70
71 define zeroext i16 @t4(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
72 entry:
73 ; 32BIT: t4:
74 ; 32BIT: movw 16(%esp), %ax
75 ; 32BIT: movw 20(%esp), %cx
76 ; 32BIT-NOT: movw %cx, %dx
77 ; 32BIT: leal (%ecx,%eax), %edx
78
79 ; 64BIT: t4:
80 ; 64BIT-NOT: movw %si, %ax
81 ; 64BIT: leal (%rsi,%rdi), %eax
82 %0 = add i16 %k, %c ; [#uses=3]
83 %1 = icmp eq i16 %k, %c ; [#uses=1]
84 br i1 %1, label %bb, label %bb1
85
86 bb: ; preds = %entry
87 tail call void @foo(i16 zeroext %0) nounwind
88 ret i16 %0
89
90 bb1: ; preds = %entry
91 ret i16 %0
92 }