Chromium Code Reviews| 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..e113796c2b8931b98a22691b9ab9bc0ddb712594 |
| --- /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(mrm) Manually add a sequence that will fire the it_safety issue. |
|
bsy
2011/09/21 22:32:17
mrm
|
| +// Not doing this now because the assembler will reject all such sequences, |
| +// so I will have to enter the hex manually. |