From: Benjamin Kramer Date: Fri, 9 Aug 2013 10:12:30 +0000 (+0000) Subject: Add lrint to the list of math builtins. It never sets errno so we can mark it as... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96943ca881fca228e50b3f6207c5c150eae95893;p=clang Add lrint to the list of math builtins. It never sets errno so we can mark it as readnone. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188065 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 71c45ffa15..906c2c0e28 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -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) diff --git a/test/CodeGen/libcall-declarations.c b/test/CodeGen/libcall-declarations.c index d07590ff11..c78e9be52f 100644 --- a/test/CodeGen/libcall-declarations.c +++ b/test/CodeGen/libcall-declarations.c @@ -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]]