mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 17:00:19 +02:00
When attempting to debug #3162 I had noticed spurious behaviour around what I assumed to be eflags getting corrupt around inlined syscalls. This turned out to be a red herring but to ensure we are still testing this, create a fully fleshed out unit test. This test ensures a couple of things. 1) A flag that is set or unset before a syscall doesn't have its data corrupt 2) An inline syscall doesn't corrupt the eflags, checking the eflag result after returning from the syscall. 3) A signal occuring while in an inline syscall returns the correct eflags information in the signal handler information This test gets accomplished by setting or unsetting a particular flag and then calling the futex syscall in a way that is guaranteed to be inlined and also wait forever. Then the parent thread will signal with a SIGTERM and read back the signal information. It does this multiple times for each flag we care about.