summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/math-builtins.c
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-12-02 17:52:00 +0000
committerSanjay Patel <spatel@rotateright.com>2017-12-02 17:52:00 +0000
commit08fba37e9d560757b1efccdd466798b85557a9f5 (patch)
tree005baa8e740a78733b866f4c480076241a57eb7e /clang/test/CodeGen/math-builtins.c
parent0c0f77d03d4ef710f96f08cb3662f48d3384ea05 (diff)
downloadbcm5719-llvm-08fba37e9d560757b1efccdd466798b85557a9f5.tar.gz
bcm5719-llvm-08fba37e9d560757b1efccdd466798b85557a9f5.zip
[CodeGen] fix mapping from fmod calls to frem instruction
Similar to D40044 and discussed in D40594. llvm-svn: 319619
Diffstat (limited to 'clang/test/CodeGen/math-builtins.c')
-rw-r--r--clang/test/CodeGen/math-builtins.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/test/CodeGen/math-builtins.c b/clang/test/CodeGen/math-builtins.c
index 805babe1cb0..799d91b4ec0 100644
--- a/clang/test/CodeGen/math-builtins.c
+++ b/clang/test/CodeGen/math-builtins.c
@@ -6,12 +6,21 @@
// Test attributes and codegen of math builtins.
void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
+ f = __builtin_fmod(f,f); f = __builtin_fmodf(f,f); f = __builtin_fmodl(f,f);
+
+// NO__ERRNO: frem double
+// NO__ERRNO: frem float
+// NO__ERRNO: frem x86_fp80
+// HAS_ERRNO: declare double @fmod(double, double) [[NOT_READNONE:#[0-9]+]]
+// HAS_ERRNO: declare float @fmodf(float, float) [[NOT_READNONE]]
+// HAS_ERRNO: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[NOT_READNONE]]
+
__builtin_atan2(f,f); __builtin_atan2f(f,f) ; __builtin_atan2l(f, f);
// NO__ERRNO: declare double @atan2(double, double) [[READNONE:#[0-9]+]]
// NO__ERRNO: declare float @atan2f(float, float) [[READNONE]]
// NO__ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[READNONE]]
-// HAS_ERRNO: declare double @atan2(double, double) [[NOT_READNONE:#[0-9]+]]
+// HAS_ERRNO: declare double @atan2(double, double) [[NOT_READNONE]]
// HAS_ERRNO: declare float @atan2f(float, float) [[NOT_READNONE]]
// HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[NOT_READNONE]]
@@ -33,13 +42,6 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
// HAS_ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC]]
// HAS_ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC]]
- __builtin_fmod(f,f); __builtin_fmodf(f,f); __builtin_fmodl(f,f);
-
-// NO__ERRNO-NOT: .fmod
-// NO__ERRNO-NOT: @fmod
-// HAS_ERRNO-NOT: .fmod
-// HAS_ERRNO-NOT: @fmod
-
__builtin_frexp(f,i); __builtin_frexpf(f,i); __builtin_frexpl(f,i);
// NO__ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE:#[0-9]+]]
OpenPOWER on IntegriCloud