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

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

Issue 1151663004: Subzero ARM: do lowerIcmp, lowerBr, and a bit of lowerCall. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix Created 5 years, 7 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/64bit.pnacl.ll ('k') | tests_lit/llvm2ice_tests/int-arg.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/branch-opt.ll
diff --git a/tests_lit/llvm2ice_tests/branch-opt.ll b/tests_lit/llvm2ice_tests/branch-opt.ll
index 41e05213568cd2fc82ab18b4dc41f512f0325615..eecd70fddaf0445d6d45b5ea734dc68b2bc1f111 100644
--- a/tests_lit/llvm2ice_tests/branch-opt.ll
+++ b/tests_lit/llvm2ice_tests/branch-opt.ll
@@ -1,10 +1,21 @@
; Tests the branch optimizations under O2 (against a lack of
; optimizations under Om1).
-; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \
-; RUN: | FileCheck --check-prefix=O2 %s
-; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 \
-; RUN: | FileCheck --check-prefix=OM1 %s
+; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
+; RUN: --target x8632 -i %s --args -O2 \
+; RUN: | %if --need=target_X8632 --command FileCheck --check-prefix=O2 %s
+
+; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
+; RUN: --target x8632 -i %s --args -Om1 \
+; RUN: | %if --need=target_X8632 --command FileCheck --check-prefix=OM1 %s
+
+; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented)
+; once enough infrastructure is in. Also, switch to --filetype=obj
+; when possible.
+; Also test Om1 when addProlog is done.
+; RUN: %if --need=target_ARM32 --command %p2i --filetype=asm --assemble \
+; RUN: --disassemble --target arm32 -i %s --args -O2 --skip-unimplemented \
+; RUN: | %if --need=target_ARM32 --command FileCheck --check-prefix ARM32O2 %s
declare void @dummy()
@@ -29,6 +40,10 @@ next:
; OM1-NEXT: jmp
; OM1: call
+; ARM32O2-LABEL: testUncondToNextBlock
+; ARM32O2: bl {{.*}} dummy
+; ARM32O2-NEXT: bl {{.*}} dummy
+
; For a conditional branch with a fallthrough to the next block, the
; fallthrough branch should be removed.
define void @testCondFallthroughToNextBlock(i32 %arg) {
@@ -62,6 +77,17 @@ target:
; OM1: call
; OM1: ret
+; Note that compare and branch folding isn't implemented yet (unlike x86-32).
+; ARM32O2-LABEL: testCondFallthroughToNextBlock
+; ARM32O2: cmp {{.*}}, #123
+; ARM32O2-NEXT: movge {{.*}}, #1
+; ARM32O2-NEXT: cmp {{.*}}, #0
+; ARM32O2-NEXT: bne
+; ARM32O2-NEXT: bl
+; ARM32O2-NEXT: bx lr
+; ARM32O2-NEXT: bl
+; ARM32O2-NEXT: bx lr
+
; For a conditional branch with the next block as the target and a
; different block as the fallthrough, the branch condition should be
; inverted, the fallthrough block changed to the target, and the
@@ -96,3 +122,15 @@ target:
; OM1: ret
; OM1: call
; OM1: ret
+
+; Note that compare and branch folding isn't implemented yet
+; (compared to x86-32).
+; ARM32O2-LABEL: testCondTargetNextBlock
+; ARM32O2: cmp {{.*}}, #123
+; ARM32O2-NEXT: movge {{.*}}, #1
+; ARM32O2-NEXT: cmp {{.*}}, #0
+; ARM32O2-NEXT: beq
+; ARM32O2-NEXT: bl
+; ARM32O2-NEXT: bx lr
+; ARM32O2-NEXT: bl
+; ARM32O2-NEXT: bx lr
« no previous file with comments | « tests_lit/llvm2ice_tests/64bit.pnacl.ll ('k') | tests_lit/llvm2ice_tests/int-arg.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698