diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-26 16:47:03 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-26 16:47:03 +0000 |
commit | b3a6901e66f55b35aa9e01bcb24134e6a65ea004 (patch) | |
tree | 4d57d73575ea3f7e30bf430920d6e96fa2a369c1 /test/Unit/ppc/floatunditf_test.c | |
parent | 8cbe163cba77c772621f89ddb33793ac170b1fa2 (diff) |
Initial import of compiler-rt.
-
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@74292 91177308-0d34-0410-b5e6-96231b3b80d8
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 000000000..68390d197 --- /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; +} |