mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 04:58:12 +00:00
Merge pull request #590 from niklasb/master
Add regression test for fsqrt hang
This commit is contained in:
commit
c127df0ed0
1 changed files with 31 additions and 0 deletions
31
tests/regress/x86_fldt_fsqrt.py
Normal file
31
tests/regress/x86_fldt_fsqrt.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
from unicorn import *
|
||||
from unicorn.x86_const import *
|
||||
from struct import pack
|
||||
|
||||
import regress
|
||||
|
||||
CODE_ADDR = 0x1000000
|
||||
CODE = (
|
||||
'\xb8\x00\x00\x00\x02' # mov eax, 0x2000000
|
||||
'\xdb\x28' # fldt [eax]
|
||||
'\xd9\xfa' # fsqrt
|
||||
)
|
||||
|
||||
DATA_ADDR = 0x2000000
|
||||
DATA = '\0\0\0\0\0\0\0\0\0\1'
|
||||
|
||||
class FldtFsqrt(regress.RegressTest):
|
||||
def test_fldt_fsqrt(self):
|
||||
uc = Uc(UC_ARCH_X86, UC_MODE_32)
|
||||
|
||||
uc.mem_map(CODE_ADDR, 0x1000)
|
||||
uc.mem_write(CODE_ADDR, CODE)
|
||||
|
||||
uc.mem_map(DATA_ADDR, 0x1000)
|
||||
uc.mem_write(DATA_ADDR, DATA)
|
||||
|
||||
uc.emu_start(CODE_ADDR, CODE_ADDR + len(CODE), 10000, 10)
|
||||
|
||||
if __name__ == '__main__':
|
||||
regress.main()
|
Loading…
Reference in a new issue