brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1001 B · 06b4a32 Raw
41 lines · c
1// RUN: %clang_builtins %s %librt -o %t && %run %t2// REQUIRES: librt_has_floatunssisfvfp3 4#include <stdio.h>5#include <stdlib.h>6#include <math.h>7#include "int_lib.h"8 9extern COMPILER_RT_ABI float __floatunssisfvfp(unsigned int a);10 11#if defined(__arm__) && defined(__ARM_FP) && (__ARM_FP & 0x4)12int test__floatunssisfvfp(unsigned int a)13{14    float actual = __floatunssisfvfp(a);15    float expected = a;16    if (actual != expected)17        printf("error in test__floatunssisfvfp(%u) = %f, expected %f\n",18               a, actual, expected);19    return actual != expected;20}21#endif22 23int main()24{25#if defined(__arm__) && defined(__ARM_FP) && (__ARM_FP & 0x4)26    if (test__floatunssisfvfp(0))27        return 1;28    if (test__floatunssisfvfp(1))29        return 1;30    if (test__floatunssisfvfp(0x7FFFFFFF))31        return 1;32    if (test__floatunssisfvfp(0x80000000))33        return 1;34    if (test__floatunssisfvfp(0xFFFFFFFF))35        return 1;36#else37    printf("skipped\n");38#endif39    return 0;40}41