From c86b984ea8ecb3e944dc3de48539f4c1f65851ea Mon Sep 17 00:00:00 2001
From: dim <dim@FreeBSD.org>
Date: Sun, 18 Jan 2015 16:23:48 +0000
Subject: Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively,
 3.6.0 RC1): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102

---
 test/CodeGen/builtins.c | 33 ++++++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

(limited to 'test/CodeGen/builtins.c')

diff --git a/test/CodeGen/builtins.c b/test/CodeGen/builtins.c
index 39bd84c..1ab29a6 100644
--- a/test/CodeGen/builtins.c
+++ b/test/CodeGen/builtins.c
@@ -171,32 +171,55 @@ void bar() {
 void test_float_builtins(float F, double D, long double LD) {
   volatile int res;
   res = __builtin_isinf(F);
-  // CHECK:  call float @fabsf(float
+  // CHECK:  call float @llvm.fabs.f32(float
   // CHECK:  fcmp oeq float {{.*}}, 0x7FF0000000000000
 
   res = __builtin_isinf(D);
-  // CHECK:  call double @fabs(double
+  // CHECK:  call double @llvm.fabs.f64(double
   // CHECK:  fcmp oeq double {{.*}}, 0x7FF0000000000000
   
   res = __builtin_isinf(LD);
-  // CHECK:  call x86_fp80 @fabsl(x86_fp80
+  // CHECK:  call x86_fp80 @llvm.fabs.f80(x86_fp80
   // CHECK:  fcmp oeq x86_fp80 {{.*}}, 0xK7FFF8000000000000000
   
   res = __builtin_isfinite(F);
   // CHECK: fcmp oeq float 
-  // CHECK: call float @fabsf
+  // CHECK: call float @llvm.fabs.f32(float
   // CHECK: fcmp une float {{.*}}, 0x7FF0000000000000
   // CHECK: and i1 
 
   res = __builtin_isnormal(F);
   // CHECK: fcmp oeq float
-  // CHECK: call float @fabsf
+  // CHECK: call float @llvm.fabs.f32(float
   // CHECK: fcmp ult float {{.*}}, 0x7FF0000000000000
   // CHECK: fcmp uge float {{.*}}, 0x3810000000000000
   // CHECK: and i1
   // CHECK: and i1
 }
 
+// CHECK-LABEL: define void @test_float_builtin_ops
+void test_float_builtin_ops(float F, double D, long double LD) {
+  volatile float resf;
+  volatile double resd;
+  volatile long double resld;
+
+  resf = __builtin_fmodf(F,F);
+  // CHECK: frem float
+
+  resd = __builtin_fmod(D,D);
+  // CHECK: frem double
+
+  resld = __builtin_fmodl(LD,LD);
+  // CHECK: frem x86_fp80
+
+  resf = __builtin_fabsf(F);
+  resd = __builtin_fabs(D);
+  resld = __builtin_fabsl(LD);
+  // CHECK: call float @llvm.fabs.f32(float
+  // CHECK: call double @llvm.fabs.f64(double
+  // CHECK: call x86_fp80 @llvm.fabs.f80(x86_fp80
+}
+
 // CHECK-LABEL: define void @test_builtin_longjmp
 void test_builtin_longjmp(void **buffer) {
   // CHECK: [[BITCAST:%.*]] = bitcast
-- 
cgit v1.1