math.floats.env.x86: more direct test for stack fault detection
parent
0701a68760
commit
7384793287
|
@ -1,21 +1,14 @@
|
||||||
USING: math.floats.env math.floats.env.x86 tools.test
|
USING: math.floats.env math.floats.env.x86 tools.test
|
||||||
alien.c-types alien.syntax classes.struct compiler.test
|
classes.struct cpu.x86.assembler cpu.x86.assembler.operands
|
||||||
math kernel sequences ;
|
compiler.test math kernel sequences alien alien.c-types ;
|
||||||
IN: math.floats.env.x86.tests
|
IN: math.floats.env.x86.tests
|
||||||
|
|
||||||
! the sqrtl function is really long double sqrtl ( long double x )
|
|
||||||
! calling it as if it had a void return leaves the return value on
|
|
||||||
! the x87 stack, so 9 calls will be guaranteed to cause a stack
|
|
||||||
! fault
|
|
||||||
STRUCT: fake-long-double { x char[20] } ;
|
|
||||||
FUNCTION-ALIAS: busted-sqrtl
|
|
||||||
void sqrtl ( fake-long-double x ) ;
|
|
||||||
|
|
||||||
[ t ] [
|
[ t ] [
|
||||||
[
|
[ [
|
||||||
[
|
void { } cdecl [
|
||||||
9 [ fake-long-double <struct> busted-sqrtl ] times
|
9 [ FLDZ ] times
|
||||||
] collect-fp-exceptions
|
] alien-assembly
|
||||||
] compile-call
|
] compile-call ] collect-fp-exceptions
|
||||||
+fp-x87-stack-fault+ swap member?
|
+fp-x87-stack-fault+ swap member?
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
Loading…
Reference in New Issue