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

Unified Diff: src/trusted/validator_arm/testdata-thumb/it_test.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/it_test.S
diff --git a/src/trusted/validator_arm/testdata-thumb/it_test.S b/src/trusted/validator_arm/testdata-thumb/it_test.S
new file mode 100644
index 0000000000000000000000000000000000000000..7dbb4b8cf4ed6a0cf7e4b357f77182c801c9f33c
--- /dev/null
+++ b/src/trusted/validator_arm/testdata-thumb/it_test.S
@@ -0,0 +1,71 @@
+#include "masks.h"
+.syntax unified
+.code 16
+.thumb_func
+.global _start
+_start:
+ // Test legit behavior
+ cmp r0, r0
+ ite eq
+ moveq r0, r0
+ movne r0, r0
+
+ // Pad to right before bundle boundary
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+
+ // Test bundle issues.
+ ite ne
+ movne r0, r0
+ moveq r0, r0
+
+ // Next bundle
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+
+
+ // Test legal branch
+ ittt ne
+ bicne r0, HIGH_TWO
+ orrne r0, LOW_FOUR
+ bxne r0
+
+ // Moving to next bundle for room...
+ mov r0, r0
+ mov r0, r0
+
+ // Test illegal branch
+ itet eq
+ biceq r0, HIGH_TWO
+ orrne r0, LOW_FOUR
+ bxeq r0
+
+ // Moving to the next bundle again
+ // (and partway in so we're not always aligned)
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+ mov r0, r0
+
+ // Test legal data write
+ itt cc
+ biccc r0, HIGH_TWO
+ strcc r1, [r0]
+
+ // Pad
+ mov r0, r0
+ mov r0, r0
+
+ // Test illegal data write
+ ite cc
+ biccc r0, HIGH_TWO
+ strcs r1, [r0]
+
+// TODO(jasonwkim) Manually add a sequence that will fire the it_safety issue.
+// Not doing this now because the assembler will reject all such sequences,
+// so I will have to enter the hex manually.

Powered by Google App Engine
This is Rietveld 408576698