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

Unified Diff: src/trusted/validator_arm/testdata-thumb/test_sp_updates.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_sp_updates.S
diff --git a/src/trusted/validator_arm/testdata-thumb/test_sp_updates.S b/src/trusted/validator_arm/testdata-thumb/test_sp_updates.S
new file mode 100644
index 0000000000000000000000000000000000000000..7070513f2dea1c479cd2f772a8c8ecd14e0530b3
--- /dev/null
+++ b/src/trusted/validator_arm/testdata-thumb/test_sp_updates.S
@@ -0,0 +1,59 @@
+@ 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.
+@ Copyright (c) 2011 Google Inc.
+
+@
+@ Tests both legal and illegal variations on SP updates.
+@
+
+#define MASK 0xC0000000
+
+.syntax unified
+.code 16
+.thumb_func
+.global _start
+_start:
+bundle0:
+ ldr r0, [sp], #4 @ SP post-update is fine.
+ ldr r0, [sp, #4]! @ SP pre-update is fine.
+
+ ldm sp!, { r0, r1, r2 } @ Update from ldm is fine.
+ stm sp!, { r0, r1, r2 } @ Update from stm is fine.
+ nop
+ nop
+bundle1:
+ bic r0, r0, #MASK
+ mov sp, r0 @ Move-to-SP is not fine preceeded by a mask
+
+ add r0, r0, #1 @ something unexpected (ERROR).
+ mov sp, r0 @ Move-to-SP not okay when preceeded by else
+ nop
+ nop
+bundle2:
+ add sp, sp, #12 @ Adding a constant is not fine
+ ldr r0, [sp] @ immediately followed by deref
+ @ error
+
+ add sp, sp, #12
+ str r0, [sp], #0 @ Or a write.
+@ @ error
+
+ add sp, sp, #12 @ Not okay when followed by
+ bic r0, r0, #12
+
+bundle3:
+ add sp, r0
+
+ nop
+ nop
+ nop
+ nop
+ nop
+ bic r0, r0, #MASK @ Likewise, move-to-SP cannot be...
+
+bundle4:
+ mov sp, r0 @ ...broken across bundle (ERROR).
+
+bundle6:
+ str r0, [sp], #42 @ Update SP using immediate post-inc: should pass.

Powered by Google App Engine
This is Rietveld 408576698