OLD | NEW |
---|---|
(Empty) | |
1 ; Tests the current state of the translator using PNaCl bitcode. | |
2 | |
3 ; RUN: llvm-as < %s | pnacl-freeze \ | |
4 ; RUN: | %llvm2ice -notranslate -verbose=inst -build-on-read \ | |
5 ; RUN: | FileCheck %s | |
6 | |
7 define i32 @Add(i32 %a, i32 %b) { | |
8 %add = add i32 %b, %a | |
9 ret i32 %add | |
10 } | |
11 | |
12 ; CHECK: define i32 @Add(i32 %__0, i32 %__1) { | |
13 ; CHECK-NEXT: bb0: | |
14 ; CHECK-NEXT: %__2 = add i32 %__1, %__0 | |
15 ; CHECK-NEXT: ret i32 %__2 | |
16 ; CHECK-NEXT: } | |
17 | |
18 define i32 @And(i32 %a, i32 %b) { | |
19 %and = and i32 %b, %a | |
20 ret i32 %and | |
21 } | |
22 | |
23 ; CHECK-NEXT: define i32 @And(i32 %__0, i32 %__1) { | |
24 ; CHECK-NEXT: bb0: | |
25 ; CHECK-NEXT: %__2 = and i32 %__1, %__0 | |
26 ; CHECK-NEXT: ret i32 %__2 | |
27 ; CHECK-NEXT: } | |
28 | |
29 define i32 @Or(i32 %a, i32 %b) { | |
30 %or = or i32 %b, %a | |
31 ret i32 %or | |
32 } | |
33 | |
34 ; CHECK-NEXT: define i32 @Or(i32 %__0, i32 %__1) { | |
35 ; CHECK-NEXT: bb0: | |
36 ; CHECK-NEXT: %__2 = or i32 %__1, %__0 | |
37 ; CHECK-NEXT: ret i32 %__2 | |
38 ; CHECK-NEXT: } | |
39 | |
40 define i32 @Xor(i32 %a, i32 %b) { | |
41 %xor = xor i32 %b, %a | |
42 ret i32 %xor | |
43 } | |
44 | |
45 ; CHECK-NEXT: define i32 @Xor(i32 %__0, i32 %__1) { | |
46 ; CHECK-NEXT: bb0: | |
47 ; CHECK-NEXT: %__2 = or i32 %__1, %__0 | |
jvoung (off chromium)
2014/07/17 23:57:56
This doesn't look like xor ?
Karl
2014/07/18 20:27:43
Done.
| |
48 ; CHECK-NEXT: ret i32 %__2 | |
49 ; CHECK-NEXT: } | |
50 | |
51 define i32 @Sub(i32 %a, i32 %b) { | |
52 %sub = sub i32 %a, %b | |
53 ret i32 %sub | |
54 } | |
55 | |
56 ; CHECK-NEXT: define i32 @Sub(i32 %__0, i32 %__1) { | |
57 ; CHECK-NEXT: bb0: | |
58 ; CHECK-NEXT: %__2 = sub i32 %__0, %__1 | |
59 ; CHECK-NEXT: ret i32 %__2 | |
60 ; CHECK-NEXT: } | |
61 | |
62 define i32 @Mul(i32 %a, i32 %b) { | |
63 %mul = mul i32 %b, %a | |
64 ret i32 %mul | |
65 } | |
66 | |
67 ; CHECK-NEXT: define i32 @Mul(i32 %__0, i32 %__1) { | |
68 ; CHECK-NEXT: bb0: | |
69 ; CHECK-NEXT: %__2 = mul i32 %__1, %__0 | |
70 ; CHECK-NEXT: ret i32 %__2 | |
71 ; CHECK-NEXT: } | |
72 | |
73 define i32 @Sdiv(i32 %a, i32 %b) { | |
74 %div = sdiv i32 %a, %b | |
75 ret i32 %div | |
76 } | |
77 | |
78 ; CHECK-NEXT: define i32 @Sdiv(i32 %__0, i32 %__1) { | |
79 ; CHECK-NEXT: bb0: | |
80 ; CHECK-NEXT: %__2 = sdiv i32 %__0, %__1 | |
81 ; CHECK-NEXT: ret i32 %__2 | |
82 ; CHECK-NEXT: } | |
83 | |
84 define i32 @Srem(i32 %a, i32 %b) { | |
85 %rem = srem i32 %a, %b | |
86 ret i32 %rem | |
87 } | |
88 | |
89 ; CHECK-NEXT: define i32 @Srem(i32 %__0, i32 %__1) { | |
90 ; CHECK-NEXT: bb0: | |
91 ; CHECK-NEXT: %__2 = srem i32 %__0, %__1 | |
92 ; CHECK-NEXT: ret i32 %__2 | |
93 ; CHECK-NEXT: } | |
94 | |
95 define i32 @Udiv(i32 %a, i32 %b) { | |
96 %div = udiv i32 %a, %b | |
97 ret i32 %div | |
98 } | |
99 | |
100 ; CHECK-NEXT: define i32 @Udiv(i32 %__0, i32 %__1) { | |
101 ; CHECK-NEXT: bb0: | |
102 ; CHECK-NEXT: %__2 = udiv i32 %__0, %__1 | |
103 ; CHECK-NEXT: ret i32 %__2 | |
104 ; CHECK-NEXT: } | |
105 | |
106 define i32 @Urem(i32 %a, i32 %b) { | |
107 %rem = urem i32 %a, %b | |
108 ret i32 %rem | |
109 } | |
110 | |
111 ; CHECK-NEXT: define i32 @Urem(i32 %__0, i32 %__1) { | |
112 ; CHECK-NEXT: bb0: | |
113 ; CHECK-NEXT: %__2 = urem i32 %__0, %__1 | |
114 ; CHECK-NEXT: ret i32 %__2 | |
115 ; CHECK-NEXT: } | |
116 | |
OLD | NEW |