This patch aims to enable the tests for the compiler-rt builtin functions (that currently already exist within compiler-rt) for PowerPC 64bit LE (ppc64le). Previously when unit tests are run, these tests would be reported as UNSUPPORTED. This patch updates the REQUIRES line for each test (to enable for ppc64le), and each test is linked against compiler-rt when running. Differential Revision: https://reviews.llvm.org/D54449 llvm-svn: 349634
34 lines
800 B
C
34 lines
800 B
C
// REQUIRES: target-is-powerpc64le
|
|
// RUN: %clang_builtins %s %librt -o %t && %run %t
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include "int_lib.h"
|
|
|
|
COMPILER_RT_ABI long double __floatditf(int64_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 = __floatditf(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;
|
|
}
|