mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-23 09:00:39 +02:00
I noticed that we weren't actually testing 32-bit displacement on 64-bit. This is an edge case on 64-bit where you can have 32-bit displacement WITHOUT it being RIP relative. This is very uncommonly used but is technically a possibility where 64-bit code can access an absolute address in the lower 2GB. With negative addresses you could technically access canonical kernel addresses in the lower 2GB if they were mapped in userspace, but since they aren't this is untestable (FEX also doesn't handle canonical kernel addresses correctly anyway). `MemoryData.asm` accidentally tested this but it didn't test both load and store sides. So let's be a bit more stringent on this.
FEX Unit tests
FEX has its own test suite for x86-64 emulation, and we also use gcc's target tests, posixtest, and gvisor's tests. We use a combination of CMake/CTest and python runner scripts.
We also regularly run and pass qemu's and valgrind's tests for validation, but those aren't in CI right now.
x86/64 testing
- A lot of handwritten assembly unit tests in 32Bit_ASM and ASM folders, run via our TestHarnessHelper
- A few handwritten IR tests in IR, run via our IRLoader
- gcc-target-tests-32 and gcc-target-tests-64, run via FEX. The tests binaries are in External/fex-gcc-target-tests-bins
Syscall testing
- 64-bit posixtest from http://posixtest.sourceforge.net/, run via FEX. The tests binaries are in External/fex-posixtest-bins
- 64-bit gvisor tests from https://github.com/google/gvisor, run via FEX. The tests binaries are in External/fex-gvisor-tests-bins