From 8b93d0a278dac590f1a40047ad4bd0d218bc9e45 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Sat, 16 Jan 2021 17:16:31 +0200 Subject: [PATCH] Tests: Add a basic const pooling test --- unittests/ASM/ConstProp/ConstPooling.asm | 83 ++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 unittests/ASM/ConstProp/ConstPooling.asm diff --git a/unittests/ASM/ConstProp/ConstPooling.asm b/unittests/ASM/ConstProp/ConstPooling.asm new file mode 100644 index 000000000..efc55f0c1 --- /dev/null +++ b/unittests/ASM/ConstProp/ConstPooling.asm @@ -0,0 +1,83 @@ +%ifdef CONFIG +{ + "Match": "All", + "RegData": { + "RAX": "0xf" + }, + "MemoryRegions": { + "0x100000000": "4096" + } +} +%endif + +mov rdx, 0xe0000000 + +; generate a lot of re-used constants +mov dword[rdx], 0x0 +mov dword[rdx], 0x1 +mov dword[rdx], 0x2 +mov dword[rdx], 0x3 +mov dword[rdx], 0x4 +mov dword[rdx], 0x5 +mov dword[rdx], 0x6 +mov dword[rdx], 0x7 +mov dword[rdx], 0x8 +mov dword[rdx], 0x9 +mov dword[rdx], 0xa +mov dword[rdx], 0xb +mov dword[rdx], 0xc +mov dword[rdx], 0xd +mov dword[rdx], 0xe +mov dword[rdx], 0xf +mov dword[rdx], 0x0 +mov dword[rdx], 0x1 +mov dword[rdx], 0x2 +mov dword[rdx], 0x3 +mov dword[rdx], 0x4 +mov dword[rdx], 0x5 +mov dword[rdx], 0x6 +mov dword[rdx], 0x7 +mov dword[rdx], 0x8 +mov dword[rdx], 0x9 +mov dword[rdx], 0xa +mov dword[rdx], 0xb +mov dword[rdx], 0xc +mov dword[rdx], 0xd +mov dword[rdx], 0xe +mov dword[rdx], 0xf +mov dword[rdx], 0x0 +mov dword[rdx], 0x1 +mov dword[rdx], 0x2 +mov dword[rdx], 0x3 +mov dword[rdx], 0x4 +mov dword[rdx], 0x5 +mov dword[rdx], 0x6 +mov dword[rdx], 0x7 +mov dword[rdx], 0x8 +mov dword[rdx], 0x9 +mov dword[rdx], 0xa +mov dword[rdx], 0xb +mov dword[rdx], 0xc +mov dword[rdx], 0xd +mov dword[rdx], 0xe +mov dword[rdx], 0xf +mov dword[rdx], 0x0 +mov dword[rdx], 0x1 +mov dword[rdx], 0x2 +mov dword[rdx], 0x3 +mov dword[rdx], 0x4 +mov dword[rdx], 0x5 +mov dword[rdx], 0x6 +mov dword[rdx], 0x7 +mov dword[rdx], 0x8 +mov dword[rdx], 0x9 +mov dword[rdx], 0xa +mov dword[rdx], 0xb +mov dword[rdx], 0xc +mov dword[rdx], 0xd +mov dword[rdx], 0xe +mov dword[rdx], 0xf + +mov eax, dword[rdx] + +hlt \ No newline at end of file