diff options
Diffstat (limited to 'test/Unit/ppc/floatunditf_test.c')
-rw-r--r-- | test/Unit/ppc/floatunditf_test.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Unit/ppc/floatunditf_test.c b/test/Unit/ppc/floatunditf_test.c new file mode 100644 index 000000000000..68390d197229 --- /dev/null +++ b/test/Unit/ppc/floatunditf_test.c @@ -0,0 +1,30 @@ +#include <stdint.h> +#include <stdio.h> + +long double __floatunditf(uint64_t); + +#include "floatunditf_test.h" +#include "DD.h" + +int main(int argc, char *argv[]) { + int i; + + DD expected; + DD computed; + + for (i=0; i<numTests; ++i) { + expected.hi = tests[i].hi; + expected.lo = tests[i].lo; + computed.ld = __floatunditf(tests[i].input); + + if ((computed.hi != expected.hi) || (computed.lo != expected.lo)) + { + printf("Error on __floatunditf( 0x%016llx ):\n", tests[i].input); + printf("\tExpected %La = ( %a , %a )\n", expected.ld, expected.hi, expected.lo); + printf("\tComputed %La = ( %a , %a )\n", computed.ld, computed.hi, computed.lo); + return 1; + } + } + + return 0; +} |