Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: tests_lit/llvm2ice_tests/arith-opt.ll

Issue 205613002: Initial skeleton of Subzero. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Use non-anonymous structs so that array_lengthof works Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/alloc.ll ('k') | tests_lit/llvm2ice_tests/arithmetic-chain.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/arith-opt.ll
diff --git a/tests_lit/llvm2ice_tests/arith-opt.ll b/tests_lit/llvm2ice_tests/arith-opt.ll
new file mode 100644
index 0000000000000000000000000000000000000000..becbc9fe1c23a05157d78aef60a9a1a1374f7888
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/arith-opt.ll
@@ -0,0 +1,110 @@
+; RUIN: %llvm2ice -verbose inst %s | FileCheck %s
+; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
+; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s
+
+define i32 @Add(i32 %a, i32 %b) {
+; CHECK: define i32 @Add
+entry:
+ %add = add i32 %b, %a
+; CHECK: add
+ tail call void @Use(i32 %add)
+; CHECK: call Use
+ ret i32 %add
+}
+
+declare void @Use(i32)
+
+define i32 @And(i32 %a, i32 %b) {
+; CHECK: define i32 @And
+entry:
+ %and = and i32 %b, %a
+; CHECK: and
+ tail call void @Use(i32 %and)
+; CHECK: call Use
+ ret i32 %and
+}
+
+define i32 @Or(i32 %a, i32 %b) {
+; CHECK: define i32 @Or
+entry:
+ %or = or i32 %b, %a
+; CHECK: or
+ tail call void @Use(i32 %or)
+; CHECK: call Use
+ ret i32 %or
+}
+
+define i32 @Xor(i32 %a, i32 %b) {
+; CHECK: define i32 @Xor
+entry:
+ %xor = xor i32 %b, %a
+; CHECK: xor
+ tail call void @Use(i32 %xor)
+; CHECK: call Use
+ ret i32 %xor
+}
+
+define i32 @Sub(i32 %a, i32 %b) {
+; CHECK: define i32 @Sub
+entry:
+ %sub = sub i32 %a, %b
+; CHECK: sub
+ tail call void @Use(i32 %sub)
+; CHECK: call Use
+ ret i32 %sub
+}
+
+define i32 @Mul(i32 %a, i32 %b) {
+; CHECK: define i32 @Mul
+entry:
+ %mul = mul i32 %b, %a
+; CHECK: imul
+ tail call void @Use(i32 %mul)
+; CHECK: call Use
+ ret i32 %mul
+}
+
+define i32 @Sdiv(i32 %a, i32 %b) {
+; CHECK: define i32 @Sdiv
+entry:
+ %div = sdiv i32 %a, %b
+; CHECK: cdq
+; CHECK: idiv
+ tail call void @Use(i32 %div)
+; CHECK: call Use
+ ret i32 %div
+}
+
+define i32 @Srem(i32 %a, i32 %b) {
+; CHECK: define i32 @Srem
+entry:
+ %rem = srem i32 %a, %b
+; CHECK: cdq
+; CHECK: idiv
+ tail call void @Use(i32 %rem)
+; CHECK: call Use
+ ret i32 %rem
+}
+
+define i32 @Udiv(i32 %a, i32 %b) {
+; CHECK: define i32 @Udiv
+entry:
+ %div = udiv i32 %a, %b
+; CHECK: div
+ tail call void @Use(i32 %div)
+; CHECK: call Use
+ ret i32 %div
+}
+
+define i32 @Urem(i32 %a, i32 %b) {
+; CHECK: define i32 @Urem
+entry:
+ %rem = urem i32 %a, %b
+; CHECK: div
+ tail call void @Use(i32 %rem)
+; CHECK: call Use
+ ret i32 %rem
+}
+
+; ERRORS-NOT: ICE translation error
+; DUMP-NOT: SZ
« no previous file with comments | « tests_lit/llvm2ice_tests/alloc.ll ('k') | tests_lit/llvm2ice_tests/arithmetic-chain.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698