brintos

brintos / llvm-project-archived public Read only

0
0
Text · 805 B · fc6090b Raw
34 lines · c
1// REQUIRES: target-is-powerpc64le2// RUN: %clang_builtins %s %librt -o %t && %run %t3#include <stdint.h>4#include <stdio.h>5#include "int_lib.h"6 7COMPILER_RT_ABI long double __floatunditf(uint64_t);8 9#include "floatunditf_test.h"10#include "DD.h"11 12int main(int argc, char *argv[]) {13	int i;14	15	DD expected;16	DD computed;17	18	for (i=0; i<numTests; ++i) {19		expected.hi = tests[i].hi;20		expected.lo = tests[i].lo;21		computed.ld = __floatunditf(tests[i].input);22		23		if ((computed.hi != expected.hi) || (computed.lo != expected.lo))24		{25			printf("Error on __floatunditf( 0x%016llx ):\n", tests[i].input);26			printf("\tExpected %La = ( %a , %a )\n", expected.ld, expected.hi, expected.lo);27			printf("\tComputed %La = ( %a , %a )\n", computed.ld, computed.hi, computed.lo);28			return 1;29		}30	}31	32	return 0;33}34