]> granicus.if.org Git - clang/commitdiff
Add lrint to the list of math builtins. It never sets errno so we can mark it as...
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 9 Aug 2013 10:12:30 +0000 (10:12 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 9 Aug 2013 10:12:30 +0000 (10:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188065 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Builtins.def
test/CodeGen/libcall-declarations.c

index 71c45ffa15a3ee31374e488e8996aca2703312fa..906c2c0e28d97a7c1b7337dee3dae52a32cdb4ff 100644 (file)
@@ -887,6 +887,10 @@ LIBBUILTIN(log2, "dd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(log2l, "LdLd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(log2f, "ff", "fe", "math.h", ALL_LANGUAGES)
 
+LIBBUILTIN(lrint, "Lid", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(lrintl, "LiLd", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(lrintf, "Lif", "fc", "math.h", ALL_LANGUAGES)
+
 LIBBUILTIN(nearbyint, "dd", "fc", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(nearbyintl, "LdLd", "fc", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(nearbyintf, "ff", "fc", "math.h", ALL_LANGUAGES)
index d07590ff11718f882cca09153cac6e579a605871..c78e9be52f7a5bd6b48e9946c00f7408a2f4c3e1 100644 (file)
@@ -50,6 +50,9 @@ float logf(float);
 double log2(double);
 long double log2l(long double);
 float log2f(float);
+long lrint(double);
+long lrintl(long double);
+long lrintf(float);
 double nearbyint(double);
 long double nearbyintl(long double);
 float nearbyintf(float);
@@ -76,15 +79,15 @@ long double truncl(long double);
 float truncf(float);
 
 // Force emission of the declare statements.
-void *use[] = {
-  acos, acosl, acosf, asin, asinl, asinf, atan, atanl, atanf, atan2, atan2l,
-  atan2f, ceil, ceill, ceilf, copysign, copysignl, copysignf, cos, cosl, cosf,
-  exp, expl, expf, exp2, exp2l, exp2f, fabs, fabsl, fabsf, floor, floorl,
-  floorf, fma, fmal, fmaf, fmax, fmaxl, fmaxf, fmin, fminl, fminf, log, logl,
-  logf, log2, log2l, log2f, nearbyint, nearbyintl, nearbyintf, pow, powl, powf,
-  rint, rintl, rintf, round, roundl, roundf, sin, sinl, sinf, sqrt, sqrtl,
-  sqrtf, tan, tanl, tanf, trunc, truncl, truncf
-};
+void *use[] = { acos, acosl, acosf, asin, asinl, asinf, atan, atanl, atanf,
+                atan2, atan2l, atan2f, ceil, ceill, ceilf, copysign, copysignl,
+                copysignf, cos, cosl, cosf, exp, expl, expf, exp2, exp2l, exp2f,
+                fabs, fabsl, fabsf, floor, floorl, floorf, fma, fmal, fmaf,
+                fmax, fmaxl, fmaxf, fmin, fminl, fminf, log, logl, logf, log2,
+                log2l, log2f, lrint, lrintl, lrintf, nearbyint, nearbyintl,
+                nearbyintf, pow, powl, powf, rint, rintl, rintf, round, roundl,
+                roundf, sin, sinl, sinf, sqrt, sqrtl, sqrtf, tan, tanl, tanf,
+                trunc, truncl, truncf };
 
 // CHECK-NOERRNO: declare double @acos(double) [[NUW:#[0-9]+]]
 // CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) [[NUW]]
@@ -134,6 +137,9 @@ void *use[] = {
 // CHECK-NOERRNO: declare double @log2(double) [[NUW]]
 // CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) [[NUW]]
 // CHECK-NOERRNO: declare float @log2f(float) [[NUW]]
+// CHECK-NOERRNO: declare {{i..}} @lrint(double) [[NUW]]
+// CHECK-NOERRNO: declare {{i..}} @lrintl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare {{i..}} @lrintf(float) [[NUW]]
 // CHECK-NOERRNO: declare double @nearbyint(double) [[NUW]]
 // CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
 // CHECK-NOERRNO: declare float @nearbyintf(float) [[NUW]]
@@ -177,6 +183,9 @@ void *use[] = {
 // CHECK-ERRNO: declare double @fmin(double, double) [[NUW]]
 // CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[NUW]]
 // CHECK-ERRNO: declare float @fminf(float, float) [[NUW]]
+// CHECK-ERRNO: declare {{i..}} @lrint(double) [[NUW]]
+// CHECK-ERRNO: declare {{i..}} @lrintl(x86_fp80) [[NUW]]
+// CHECK-ERRNO: declare {{i..}} @lrintf(float) [[NUW]]
 // CHECK-ERRNO: declare double @nearbyint(double) [[NUW]]
 // CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
 // CHECK-ERRNO: declare float @nearbyintf(float) [[NUW]]