diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-22 18:50:01 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-22 18:50:01 +0000 |
commit | c4aecf9994444e1907670a39e72c25b3b76cbb97 (patch) | |
tree | e91c7d0e7d53e58535f8eee9e18d5f420ed22042 /clang/test/CodeGen/libcall-declarations.c | |
parent | c50ce97745ad9a5ef352e60d04f3c4b471186690 (diff) | |
download | bcm5719-llvm-c4aecf9994444e1907670a39e72c25b3b76cbb97.tar.gz bcm5719-llvm-c4aecf9994444e1907670a39e72c25b3b76cbb97.zip |
Make ceil/floor/nearbyint/rint/round const even with -fmath-errno.
The conditions described by POSIX can never happen with IEEE-754 floats.
When the function is const we can emit a single sse4.1 instruction for
it, without losing anything :)
llvm-svn: 162379
Diffstat (limited to 'clang/test/CodeGen/libcall-declarations.c')
-rw-r--r-- | clang/test/CodeGen/libcall-declarations.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/test/CodeGen/libcall-declarations.c b/clang/test/CodeGen/libcall-declarations.c index 46a024a3416..4517643e4c4 100644 --- a/clang/test/CodeGen/libcall-declarations.c +++ b/clang/test/CodeGen/libcall-declarations.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin12 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=CHECK-NOERRNO -// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -o - -emit-llvm %s | FileCheck %s -check-prefix=CHECK-ERRNO +// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=CHECK-ERRNO // Prototypes. double acos(double); @@ -159,18 +159,33 @@ void *use[] = { // CHECK-NOERRNO: declare x86_fp80 @truncl(x86_fp80) nounwind readnone // CHECK-NOERRNO: declare float @truncf(float) nounwind readnone +// CHECK-ERRNO: declare double @ceil(double) nounwind readnone +// CHECK-ERRNO: declare x86_fp80 @ceill(x86_fp80) nounwind readnone +// CHECK-ERRNO: declare float @ceilf(float) nounwind readnone // CHECK-ERRNO: declare double @copysign(double, double) nounwind readnone // CHECK-ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone // CHECK-ERRNO: declare float @copysignf(float, float) nounwind readnone // CHECK-ERRNO: declare double @fabs(double) nounwind readnone // CHECK-ERRNO: declare x86_fp80 @fabsl(x86_fp80) nounwind readnone // CHECK-ERRNO: declare float @fabsf(float) nounwind readnone +// CHECK-ERRNO: declare double @floor(double) nounwind readnone +// CHECK-ERRNO: declare x86_fp80 @floorl(x86_fp80) nounwind readnone +// CHECK-ERRNO: declare float @floorf(float) nounwind readnone // CHECK-ERRNO: declare double @fmax(double, double) nounwind readnone // CHECK-ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) nounwind readnone // CHECK-ERRNO: declare float @fmaxf(float, float) nounwind readnone // CHECK-ERRNO: declare double @fmin(double, double) nounwind readnone // CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) nounwind readnone // CHECK-ERRNO: declare float @fminf(float, float) nounwind readnone +// CHECK-ERRNO: declare double @nearbyint(double) nounwind readnone +// CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) nounwind readnone +// CHECK-ERRNO: declare float @nearbyintf(float) nounwind readnone +// CHECK-ERRNO: declare double @rint(double) nounwind readnone +// CHECK-ERRNO: declare x86_fp80 @rintl(x86_fp80) nounwind readnone +// CHECK-ERRNO: declare float @rintf(float) nounwind readnone +// CHECK-ERRNO: declare double @round(double) nounwind readnone +// CHECK-ERRNO: declare x86_fp80 @roundl(x86_fp80) nounwind readnone +// CHECK-ERRNO: declare float @roundf(float) nounwind readnone // CHECK-ERRNO: declare double @trunc(double) nounwind readnone // CHECK-ERRNO: declare x86_fp80 @truncl(x86_fp80) nounwind readnone // CHECK-ERRNO: declare float @truncf(float) nounwind readnone |