
Summary: Originally, a few tests fail for armhf target due to: 1) COMPILER_RT_ARMHF_TARGET was not set when building the lib 2) COMPILER_RT_ABI should not be defined as `__attribute__((pcs("aapcs")))` for armhf when building for both lib and tests This address https://bugs.llvm.org//show_bug.cgi?id=32261 mulsc3_test.c is a newly exposed issue, which will be addressed separately. Reviewers: rengolin, compnerd Reviewed By: compnerd Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D31448 llvm-svn: 298974
41 lines
1020 B
C
41 lines
1020 B
C
// RUN: %clang_builtins %s %librt -o %t && %run %t
|
|
|
|
//===--------------- truncdfsf2_test.c - Test __truncdfsf2 ----------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file tests __truncdfsf2 for the compiler_rt library.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "fp_test.h"
|
|
|
|
float __truncdfsf2(double a);
|
|
|
|
int test__truncdfsf2(double a)
|
|
{
|
|
float actual = __truncdfsf2(a);
|
|
float expected = a;
|
|
|
|
if (actual != expected) {
|
|
printf("error in test__truncdfsf2(%lf) = %f, "
|
|
"expected %f\n", a, actual, expected);
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
if (test__truncdfsf2(340282366920938463463374607431768211456.0))
|
|
return 1;
|
|
return 0;
|
|
}
|