From 5fc8791857295092b6d90262e7a5760b2fe89419 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 3 Nov 2018 20:03:06 +0300 Subject: [PATCH] test: nasm-t -- Add vmread test Signed-off-by: Cyrill Gorcunov --- travis/test/vmread.asm | 24 ++++++++++++++++++++++++ travis/test/vmread.bin.t | Bin 0 -> 60 bytes travis/test/vmread.json | 20 ++++++++++++++++++++ travis/test/vmread.stderr | 6 ++++++ 4 files changed, 50 insertions(+) create mode 100644 travis/test/vmread.asm create mode 100644 travis/test/vmread.bin.t create mode 100644 travis/test/vmread.json create mode 100644 travis/test/vmread.stderr diff --git a/travis/test/vmread.asm b/travis/test/vmread.asm new file mode 100644 index 00000000..04eb59d6 --- /dev/null +++ b/travis/test/vmread.asm @@ -0,0 +1,24 @@ + bits 32 + vmread dword [0], eax + vmwrite eax, dword [0] + vmread [0], eax + vmwrite eax, [0] + + bits 64 + vmread qword [0], rax + vmwrite rax, qword [0] + vmread [0], rax + vmwrite rax, [0] + +%ifdef ERROR + bits 32 + vmread qword [0], eax + vmwrite eax, qword [0] + + bits 64 + vmread dword [0], eax + vmwrite eax, dword [0] + + vmread qword [0], eax + vmwrite eax, qword [0] +%endif diff --git a/travis/test/vmread.bin.t b/travis/test/vmread.bin.t new file mode 100644 index 0000000000000000000000000000000000000000..37d3cbcb3c8556ef926e1618c1d6ded011042c8f GIT binary patch literal 60 acmd1NJ8lfR6YQnI0W?o literal 0 HcmV?d00001 diff --git a/travis/test/vmread.json b/travis/test/vmread.json new file mode 100644 index 00000000..32049d46 --- /dev/null +++ b/travis/test/vmread.json @@ -0,0 +1,20 @@ +[ + { + "description": "Test vmread instruction", + "id": "vmread", + "format": "bin", + "source": "vmread.asm", + "target": [ + { "output": "vmread.bin" } + ] + }, + { + "description": "Test errors in vmread instruction", + "ref": "vmread", + "option": "-DERROR", + "target": [ + { "stderr": "vmread.stderr" } + ], + "error": "expected" + } +] diff --git a/travis/test/vmread.stderr b/travis/test/vmread.stderr new file mode 100644 index 00000000..78e91df2 --- /dev/null +++ b/travis/test/vmread.stderr @@ -0,0 +1,6 @@ +./travis/test/vmread.asm:15: error: invalid combination of opcode and operands +./travis/test/vmread.asm:16: error: invalid combination of opcode and operands +./travis/test/vmread.asm:19: error: instruction not supported in 64-bit mode +./travis/test/vmread.asm:20: error: instruction not supported in 64-bit mode +./travis/test/vmread.asm:22: error: invalid combination of opcode and operands +./travis/test/vmread.asm:23: error: invalid combination of opcode and operands