]> gitweb.factorcode.org Git - factor.git/commitdiff
math.floats.env.x86: more direct test for stack fault detection
authorJoe Groff <arcata@gmail.com>
Sat, 14 Aug 2010 05:19:54 +0000 (22:19 -0700)
committerJoe Groff <arcata@gmail.com>
Sat, 14 Aug 2010 05:20:16 +0000 (22:20 -0700)
basis/math/floats/env/x86/x86-tests.factor

index 928c5021c84da0d36fbbbbe0214a389986525cbe..4a77af985619ce3de36dc637fabcbe7d8919779c 100644 (file)
@@ -1,21 +1,14 @@
 USING: math.floats.env math.floats.env.x86 tools.test
-alien.c-types alien.syntax classes.struct compiler.test
-math kernel sequences ;
+classes.struct cpu.x86.assembler cpu.x86.assembler.operands
+compiler.test math kernel sequences alien alien.c-types ;
 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 ] [
-    [
-        [
-            9 [ fake-long-double <struct> busted-sqrtl ] times
-        ] collect-fp-exceptions
-    ] compile-call
+    [ [
+        void { } cdecl [
+            9 [ FLDZ ] times
+        ] alien-assembly
+    ] compile-call ] collect-fp-exceptions
     +fp-x87-stack-fault+ swap member?
 ] unit-test