X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/9e225d036f7ada46c87f40647ed12d4c406f502f..197008ea33f135c7c4f94a67a2f75a9df7b7771d:/unit-tests/test-cases/lazy-binding-reg-params/foo.c diff --git a/unit-tests/test-cases/lazy-binding-reg-params/foo.c b/unit-tests/test-cases/lazy-binding-reg-params/foo.c index c136321..7270f66 100644 --- a/unit-tests/test-cases/lazy-binding-reg-params/foo.c +++ b/unit-tests/test-cases/lazy-binding-reg-params/foo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2005 Apple Computer p1, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -20,12 +20,14 @@ * * @APPLE_LICENSE_HEADER_END@ */ -#include // fprintf(), NULL +#include +#include "foo.h" + #if __i386__ __attribute__((regparm(3))) #endif -bool inttest(int p1, int p2, int p3, int p4, int p5) +bool dointtest(int p1, int p2, int p3, int p4, int p5) { if ( p1 != 123) return false; @@ -40,4 +42,67 @@ bool inttest(int p1, int p2, int p3, int p4, int p5) return true; } +#if __ppc__ || __ppc64__ +bool dofloattest(double p1, double p2, double p3, double p4, double p5, double p6, double p7, + double p8, double p9, double p10, double p11, double p12, double p13) +{ + if ( p1 != 1.0 ) + return false; + if ( p2 != 2.0 ) + return false; + if ( p3 != 3.0 ) + return false; + if ( p4 != 4.0 ) + return false; + if ( p5 != 5.0 ) + return false; + if ( p6 != 6.0 ) + return false; + if ( p7 != 7.0 ) + return false; + if ( p8 != 8.0 ) + return false; + if ( p9 != 9.0 ) + return false; + if ( p10 != 10.0) + return false; + if ( p11 != 11.0) + return false; + if ( p12 != 12.0) + return false; + if ( p13 != 13.0) + return false; + return true; +} +#endif + + +static bool comparevFloat(vFloat p1, vFloat p2) +{ + return (memcmp(&p1, &p2, 16) == 0); +} + +bool dovectortest(vFloat p1, vFloat p2, vFloat p3, vFloat p4, vFloat p5) +{ + vFloat r1 = { 1.1, 1.2, 1.3, 1.4 }; + vFloat r2 = { 2.1, 2.2, 2.3, 2.4 }; + vFloat r3 = { 3.1, 3.2, 3.3, 3.4 }; + vFloat r4 = { 4.1, 4.2, 4.3, 4.4 }; + vFloat r5 = { 5.1, 5.2, 5.3, 5.4 }; + + if ( !comparevFloat(p1, r1) ) + return false; + if ( !comparevFloat(p2, r2) ) + return false; + if ( !comparevFloat(p3, r3) ) + return false; + if ( !comparevFloat(p4, r4) ) + return false; + if ( !comparevFloat(p5, r5) ) + return false; + return true; +} + + +