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

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: fix comma 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..5d044ece04ae0db3cb1caa95258517b060d05e7f
--- /dev/null
+++ b/src/trusted/validator_arm/testdata-thumb/test_internal_jumps.S
@@ -0,0 +1,74 @@
+@ Copyright 2010 The Native Client Authors. All rights reserved.
bsy 2011/09/21 22:32:17 (c) 2011 etc
jasonwkim 2011/09/26 21:35:52 done
+@ 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