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

Unified Diff: src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S

Issue 7799013: Intial Thumb2 Sandbox (naclrev 6680) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: asdsa Created 9 years, 3 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
Index: src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S
diff --git a/src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S b/src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S
new file mode 100644
index 0000000000000000000000000000000000000000..2781992c25c026987ab4d150d34de58d9d1381a8
--- /dev/null
+++ b/src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S
@@ -0,0 +1,74 @@
+@ Copyright (c) 2011 The Native Client Authors. All rights reserved.
+@ Use of this source code is governed by a BSD-style license that can be
+@ found in the LICENSE file.
+
+.code 16
+.syntax unified
+.globl _start
+.thumb_func
+_start:
+
+@ Test forwards jumps
+ b bundle_good
+ b middle_good
+ b middle_bad
+
+@ Nop pad to bundle alignment
+nop
+nop
+nop
+nop
+nop
+nop
+nop
+nop
+nop
+nop
+
+bundle_good:
+ nop
+middle_good:
+ bic lr, lr, #0xf0000000
+ orr lr, lr, #0x0000000f
+middle_bad:
+ bx lr
+
+@ Test backwards jumps
+
+ b bundle_good
+ b middle_good
+ b middle_bad
+
+@ Another nop pad
+nop
+nop
+nop
+nop
+
+@ Test similar jumps with variations on the mask
+
+ bic lr, lr, #0xc0000000 @ 1GiB mask
+ orr lr, lr, #0x0000000f
+ bx lr @ should succeed
+
+ bic lr, lr, #0x80000000 @ 2GiB mask
+ orr lr, lr, #0x0000000f
+ bx lr @ must fail
+
+ bic lr, lr, #0xe0000000 @ in between mask
+ orr lr, lr, #0x0000000f
+ bx lr @ also succeeds
+
+@ Test the OR mask now
+
+ bic lr, lr, #0xc0000000 @ 1GiB mask
+ orr lr, lr, #0x0000001f
+ bx lr @ should fail (additional bit set)
+
+ bic lr, lr, #0xc0000000
+ bx lr @ must fail (no oring)
+
+ bic lr, lr, #0xc0000000 @ in between mask
+ orr lr, lr, #0x0000000e
+ bx lr @ must fail (too few bits set)
+

Powered by Google App Engine
This is Rietveld 408576698