Index: src/trusted/validator_x86/testdata/64/push.tf |
diff --git a/src/trusted/validator_x86/testdata/64/push.tf b/src/trusted/validator_x86/testdata/64/push.tf |
new file mode 100644 |
index 0000000000000000000000000000000000000000..74e3966660e3f575c987442bff643e617eec6668 |
--- /dev/null |
+++ b/src/trusted/validator_x86/testdata/64/push.tf |
@@ -0,0 +1,31 @@ |
+BITS: 64 |
+OUTCOME: invalid |
+ |
+# Tests that push operand sizes work correctly. |
+ |
+# The following tests the default size (which is 4 bytes). |
+asm: pushq $0x6050403 |
+hex: 68 03 04 05 06 |
+ |
+ |
+# The following tests that rex.w doesn't effect the size. |
+asm: rex.W pushq $0x6050403 |
+hex: 48 68 03 04 05 06 |
+ |
+ |
+# The following tests that data66 defines the size as 2 bytes. |
+asm: data16; .byte 0x68; .byte 0x3; .byte 0x4 |
+hex: 66 68 03 04 |
+ |
+ |
+# The following shows that we don't allow rex.w and a data 66 prefix. |
+asm: data16; rex.W; .byte 0x68; .byte 0x3; .byte 0x4 |
+hex: 66 48 68 03 04 |
+nc_out: ERROR: Opcode sequence doesn't define a valid x86 instruction |
+nc_out: ERROR: Use of DATA16 (66) prefix for instruction not allowed by Native Client |
+nc_out: [at +3] ERROR: Invalid base register in memory offset |
+ |
+ |
+asm: nop; nop; nop; nop |
+hex: 90 90 90 90 |
+ |