Sanjay Patel | 594d217 | 2017-11-03 16:27:27 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm %s | FileCheck %s -check-prefix=NO__ERRNO |
| 2 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO |
| 3 | |
Sanjay Patel | 040fbe3 | 2017-11-07 15:13:22 +0000 | [diff] [blame] | 4 | // Test attributes and builtin codegen of math library calls. |
Sanjay Patel | 594d217 | 2017-11-03 16:27:27 +0000 | [diff] [blame] | 5 | |
Sanjay Patel | 040fbe3 | 2017-11-07 15:13:22 +0000 | [diff] [blame] | 6 | void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) { |
Sanjay Patel | 594d217 | 2017-11-03 16:27:27 +0000 | [diff] [blame] | 7 | atan2(f,f); atan2f(f,f) ; atan2l(f, f); |
| 8 | |
| 9 | // NO__ERRNO: declare double @atan2(double, double) [[READNONE:#[0-9]+]] |
| 10 | // NO__ERRNO: declare float @atan2f(float, float) [[READNONE]] |
| 11 | // NO__ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[READNONE]] |
| 12 | // HAS_ERRNO: declare double @atan2(double, double) [[NOT_READNONE:#[0-9]+]] |
| 13 | // HAS_ERRNO: declare float @atan2f(float, float) [[NOT_READNONE]] |
| 14 | // HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 15 | |
| 16 | copysign(f,f); copysignf(f,f);copysignl(f,f); |
| 17 | |
| 18 | // NO__ERRNO: declare double @copysign(double, double) [[READNONE]] |
| 19 | // NO__ERRNO: declare float @copysignf(float, float) [[READNONE]] |
| 20 | // NO__ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) [[READNONE]] |
| 21 | // HAS_ERRNO: declare double @copysign(double, double) [[READNONE:#[0-9]+]] |
| 22 | // HAS_ERRNO: declare float @copysignf(float, float) [[READNONE]] |
| 23 | // HAS_ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) [[READNONE]] |
| 24 | |
| 25 | fabs(f); fabsf(f); fabsl(f); |
| 26 | |
| 27 | // NO__ERRNO: declare double @fabs(double) [[READNONE]] |
| 28 | // NO__ERRNO: declare float @fabsf(float) [[READNONE]] |
| 29 | // NO__ERRNO: declare x86_fp80 @fabsl(x86_fp80) [[READNONE]] |
| 30 | // HAS_ERRNO: declare double @fabs(double) [[READNONE]] |
| 31 | // HAS_ERRNO: declare float @fabsf(float) [[READNONE]] |
| 32 | // HAS_ERRNO: declare x86_fp80 @fabsl(x86_fp80) [[READNONE]] |
| 33 | |
| 34 | fmod(f,f); fmodf(f,f); fmodl(f,f); |
| 35 | |
| 36 | // NO__ERRNO: declare double @fmod(double, double) [[READNONE]] |
| 37 | // NO__ERRNO: declare float @fmodf(float, float) [[READNONE]] |
| 38 | // NO__ERRNO: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[READNONE]] |
| 39 | // HAS_ERRNO: declare double @fmod(double, double) [[NOT_READNONE]] |
| 40 | // HAS_ERRNO: declare float @fmodf(float, float) [[NOT_READNONE]] |
| 41 | // HAS_ERRNO: declare x86_fp80 @fmodl(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 42 | |
| 43 | frexp(f,i); frexpf(f,i); frexpl(f,i); |
| 44 | |
| 45 | // NO__ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE:#[0-9]+]] |
| 46 | // NO__ERRNO: declare float @frexpf(float, i32*) [[NOT_READNONE]] |
| 47 | // NO__ERRNO: declare x86_fp80 @frexpl(x86_fp80, i32*) [[NOT_READNONE]] |
| 48 | // HAS_ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE]] |
| 49 | // HAS_ERRNO: declare float @frexpf(float, i32*) [[NOT_READNONE]] |
| 50 | // HAS_ERRNO: declare x86_fp80 @frexpl(x86_fp80, i32*) [[NOT_READNONE]] |
| 51 | |
| 52 | ldexp(f,f); ldexpf(f,f); ldexpl(f,f); |
| 53 | |
| 54 | // NO__ERRNO: declare double @ldexp(double, i32) [[READNONE]] |
| 55 | // NO__ERRNO: declare float @ldexpf(float, i32) [[READNONE]] |
| 56 | // NO__ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[READNONE]] |
| 57 | // HAS_ERRNO: declare double @ldexp(double, i32) [[NOT_READNONE]] |
| 58 | // HAS_ERRNO: declare float @ldexpf(float, i32) [[NOT_READNONE]] |
| 59 | // HAS_ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[NOT_READNONE]] |
| 60 | |
| 61 | modf(f,d); modff(f,fp); modfl(f,l); |
| 62 | |
| 63 | // NO__ERRNO: declare double @modf(double, double*) [[NOT_READNONE]] |
| 64 | // NO__ERRNO: declare float @modff(float, float*) [[NOT_READNONE]] |
| 65 | // NO__ERRNO: declare x86_fp80 @modfl(x86_fp80, x86_fp80*) [[NOT_READNONE]] |
| 66 | // HAS_ERRNO: declare double @modf(double, double*) [[NOT_READNONE]] |
| 67 | // HAS_ERRNO: declare float @modff(float, float*) [[NOT_READNONE]] |
| 68 | // HAS_ERRNO: declare x86_fp80 @modfl(x86_fp80, x86_fp80*) [[NOT_READNONE]] |
| 69 | |
| 70 | nan(c); nanf(c); nanl(c); |
| 71 | |
| 72 | // NO__ERRNO: declare double @nan(i8*) [[READONLY:#[0-9]+]] |
| 73 | // NO__ERRNO: declare float @nanf(i8*) [[READONLY]] |
| 74 | // NO__ERRNO: declare x86_fp80 @nanl(i8*) [[READONLY]] |
| 75 | // HAS_ERRNO: declare double @nan(i8*) [[READONLY:#[0-9]+]] |
| 76 | // HAS_ERRNO: declare float @nanf(i8*) [[READONLY]] |
| 77 | // HAS_ERRNO: declare x86_fp80 @nanl(i8*) [[READONLY]] |
| 78 | |
| 79 | pow(f,f); powf(f,f); powl(f,f); |
| 80 | |
| 81 | // NO__ERRNO: declare double @llvm.pow.f64(double, double) [[READNONE_INTRINSIC:#[0-9]+]] |
| 82 | // NO__ERRNO: declare float @llvm.pow.f32(float, float) [[READNONE_INTRINSIC]] |
| 83 | // NO__ERRNO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]] |
| 84 | // HAS_ERRNO: declare double @pow(double, double) [[NOT_READNONE]] |
| 85 | // HAS_ERRNO: declare float @powf(float, float) [[NOT_READNONE]] |
| 86 | // HAS_ERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 87 | |
| 88 | /* math */ |
| 89 | acos(f); acosf(f); acosl(f); |
| 90 | |
| 91 | // NO__ERRNO: declare double @acos(double) [[READNONE]] |
| 92 | // NO__ERRNO: declare float @acosf(float) [[READNONE]] |
| 93 | // NO__ERRNO: declare x86_fp80 @acosl(x86_fp80) [[READNONE]] |
| 94 | // HAS_ERRNO: declare double @acos(double) [[NOT_READNONE]] |
| 95 | // HAS_ERRNO: declare float @acosf(float) [[NOT_READNONE]] |
| 96 | // HAS_ERRNO: declare x86_fp80 @acosl(x86_fp80) [[NOT_READNONE]] |
| 97 | |
| 98 | acosh(f); acoshf(f); acoshl(f); |
| 99 | |
| 100 | // NO__ERRNO: declare double @acosh(double) [[READNONE]] |
| 101 | // NO__ERRNO: declare float @acoshf(float) [[READNONE]] |
| 102 | // NO__ERRNO: declare x86_fp80 @acoshl(x86_fp80) [[READNONE]] |
| 103 | // HAS_ERRNO: declare double @acosh(double) [[NOT_READNONE]] |
| 104 | // HAS_ERRNO: declare float @acoshf(float) [[NOT_READNONE]] |
| 105 | // HAS_ERRNO: declare x86_fp80 @acoshl(x86_fp80) [[NOT_READNONE]] |
| 106 | |
| 107 | asin(f); asinf(f); asinl(f); |
| 108 | |
| 109 | // NO__ERRNO: declare double @asin(double) [[READNONE]] |
| 110 | // NO__ERRNO: declare float @asinf(float) [[READNONE]] |
| 111 | // NO__ERRNO: declare x86_fp80 @asinl(x86_fp80) [[READNONE]] |
| 112 | // HAS_ERRNO: declare double @asin(double) [[NOT_READNONE]] |
| 113 | // HAS_ERRNO: declare float @asinf(float) [[NOT_READNONE]] |
| 114 | // HAS_ERRNO: declare x86_fp80 @asinl(x86_fp80) [[NOT_READNONE]] |
| 115 | |
| 116 | asinh(f); asinhf(f); asinhl(f); |
| 117 | |
| 118 | // NO__ERRNO: declare double @asinh(double) [[READNONE]] |
| 119 | // NO__ERRNO: declare float @asinhf(float) [[READNONE]] |
| 120 | // NO__ERRNO: declare x86_fp80 @asinhl(x86_fp80) [[READNONE]] |
| 121 | // HAS_ERRNO: declare double @asinh(double) [[NOT_READNONE]] |
| 122 | // HAS_ERRNO: declare float @asinhf(float) [[NOT_READNONE]] |
| 123 | // HAS_ERRNO: declare x86_fp80 @asinhl(x86_fp80) [[NOT_READNONE]] |
| 124 | |
| 125 | atan(f); atanf(f); atanl(f); |
| 126 | |
| 127 | // NO__ERRNO: declare double @atan(double) [[READNONE]] |
| 128 | // NO__ERRNO: declare float @atanf(float) [[READNONE]] |
| 129 | // NO__ERRNO: declare x86_fp80 @atanl(x86_fp80) [[READNONE]] |
| 130 | // HAS_ERRNO: declare double @atan(double) [[NOT_READNONE]] |
| 131 | // HAS_ERRNO: declare float @atanf(float) [[NOT_READNONE]] |
| 132 | // HAS_ERRNO: declare x86_fp80 @atanl(x86_fp80) [[NOT_READNONE]] |
| 133 | |
| 134 | atanh(f); atanhf(f); atanhl(f); |
| 135 | |
| 136 | // NO__ERRNO: declare double @atanh(double) [[READNONE]] |
| 137 | // NO__ERRNO: declare float @atanhf(float) [[READNONE]] |
| 138 | // NO__ERRNO: declare x86_fp80 @atanhl(x86_fp80) [[READNONE]] |
| 139 | // HAS_ERRNO: declare double @atanh(double) [[NOT_READNONE]] |
| 140 | // HAS_ERRNO: declare float @atanhf(float) [[NOT_READNONE]] |
| 141 | // HAS_ERRNO: declare x86_fp80 @atanhl(x86_fp80) [[NOT_READNONE]] |
| 142 | |
| 143 | cbrt(f); cbrtf(f); cbrtl(f); |
| 144 | |
| 145 | // NO__ERRNO: declare double @cbrt(double) [[READNONE]] |
| 146 | // NO__ERRNO: declare float @cbrtf(float) [[READNONE]] |
| 147 | // NO__ERRNO: declare x86_fp80 @cbrtl(x86_fp80) [[READNONE]] |
| 148 | // HAS_ERRNO: declare double @cbrt(double) [[NOT_READNONE]] |
| 149 | // HAS_ERRNO: declare float @cbrtf(float) [[NOT_READNONE]] |
| 150 | // HAS_ERRNO: declare x86_fp80 @cbrtl(x86_fp80) [[NOT_READNONE]] |
| 151 | |
| 152 | ceil(f); ceilf(f); ceill(f); |
| 153 | |
| 154 | // NO__ERRNO: declare double @ceil(double) [[READNONE]] |
| 155 | // NO__ERRNO: declare float @ceilf(float) [[READNONE]] |
| 156 | // NO__ERRNO: declare x86_fp80 @ceill(x86_fp80) [[READNONE]] |
| 157 | // HAS_ERRNO: declare double @ceil(double) [[READNONE]] |
| 158 | // HAS_ERRNO: declare float @ceilf(float) [[READNONE]] |
| 159 | // HAS_ERRNO: declare x86_fp80 @ceill(x86_fp80) [[READNONE]] |
| 160 | |
| 161 | cos(f); cosf(f); cosl(f); |
| 162 | |
| 163 | // NO__ERRNO: declare double @cos(double) [[READNONE]] |
| 164 | // NO__ERRNO: declare float @cosf(float) [[READNONE]] |
| 165 | // NO__ERRNO: declare x86_fp80 @cosl(x86_fp80) [[READNONE]] |
| 166 | // HAS_ERRNO: declare double @cos(double) [[NOT_READNONE]] |
| 167 | // HAS_ERRNO: declare float @cosf(float) [[NOT_READNONE]] |
| 168 | // HAS_ERRNO: declare x86_fp80 @cosl(x86_fp80) [[NOT_READNONE]] |
| 169 | |
| 170 | cosh(f); coshf(f); coshl(f); |
| 171 | |
| 172 | // NO__ERRNO: declare double @cosh(double) [[READNONE]] |
| 173 | // NO__ERRNO: declare float @coshf(float) [[READNONE]] |
| 174 | // NO__ERRNO: declare x86_fp80 @coshl(x86_fp80) [[READNONE]] |
| 175 | // HAS_ERRNO: declare double @cosh(double) [[NOT_READNONE]] |
| 176 | // HAS_ERRNO: declare float @coshf(float) [[NOT_READNONE]] |
| 177 | // HAS_ERRNO: declare x86_fp80 @coshl(x86_fp80) [[NOT_READNONE]] |
| 178 | |
| 179 | erf(f); erff(f); erfl(f); |
| 180 | |
| 181 | // NO__ERRNO: declare double @erf(double) [[READNONE]] |
| 182 | // NO__ERRNO: declare float @erff(float) [[READNONE]] |
| 183 | // NO__ERRNO: declare x86_fp80 @erfl(x86_fp80) [[READNONE]] |
| 184 | // HAS_ERRNO: declare double @erf(double) [[NOT_READNONE]] |
| 185 | // HAS_ERRNO: declare float @erff(float) [[NOT_READNONE]] |
| 186 | // HAS_ERRNO: declare x86_fp80 @erfl(x86_fp80) [[NOT_READNONE]] |
| 187 | |
| 188 | erfc(f); erfcf(f); erfcl(f); |
| 189 | |
| 190 | // NO__ERRNO: declare double @erfc(double) [[READNONE]] |
| 191 | // NO__ERRNO: declare float @erfcf(float) [[READNONE]] |
| 192 | // NO__ERRNO: declare x86_fp80 @erfcl(x86_fp80) [[READNONE]] |
| 193 | // HAS_ERRNO: declare double @erfc(double) [[NOT_READNONE]] |
| 194 | // HAS_ERRNO: declare float @erfcf(float) [[NOT_READNONE]] |
| 195 | // HAS_ERRNO: declare x86_fp80 @erfcl(x86_fp80) [[NOT_READNONE]] |
| 196 | |
| 197 | exp(f); expf(f); expl(f); |
| 198 | |
| 199 | // NO__ERRNO: declare double @exp(double) [[READNONE]] |
| 200 | // NO__ERRNO: declare float @expf(float) [[READNONE]] |
| 201 | // NO__ERRNO: declare x86_fp80 @expl(x86_fp80) [[READNONE]] |
| 202 | // HAS_ERRNO: declare double @exp(double) [[NOT_READNONE]] |
| 203 | // HAS_ERRNO: declare float @expf(float) [[NOT_READNONE]] |
| 204 | // HAS_ERRNO: declare x86_fp80 @expl(x86_fp80) [[NOT_READNONE]] |
| 205 | |
| 206 | exp2(f); exp2f(f); exp2l(f); |
| 207 | |
| 208 | // NO__ERRNO: declare double @exp2(double) [[READNONE]] |
| 209 | // NO__ERRNO: declare float @exp2f(float) [[READNONE]] |
| 210 | // NO__ERRNO: declare x86_fp80 @exp2l(x86_fp80) [[READNONE]] |
| 211 | // HAS_ERRNO: declare double @exp2(double) [[NOT_READNONE]] |
| 212 | // HAS_ERRNO: declare float @exp2f(float) [[NOT_READNONE]] |
| 213 | // HAS_ERRNO: declare x86_fp80 @exp2l(x86_fp80) [[NOT_READNONE]] |
| 214 | |
| 215 | expm1(f); expm1f(f); expm1l(f); |
| 216 | |
| 217 | // NO__ERRNO: declare double @expm1(double) [[READNONE]] |
| 218 | // NO__ERRNO: declare float @expm1f(float) [[READNONE]] |
| 219 | // NO__ERRNO: declare x86_fp80 @expm1l(x86_fp80) [[READNONE]] |
| 220 | // HAS_ERRNO: declare double @expm1(double) [[NOT_READNONE]] |
| 221 | // HAS_ERRNO: declare float @expm1f(float) [[NOT_READNONE]] |
| 222 | // HAS_ERRNO: declare x86_fp80 @expm1l(x86_fp80) [[NOT_READNONE]] |
| 223 | |
| 224 | fdim(f,f); fdimf(f,f); fdiml(f,f); |
| 225 | |
| 226 | // NO__ERRNO: declare double @fdim(double, double) [[READNONE]] |
| 227 | // NO__ERRNO: declare float @fdimf(float, float) [[READNONE]] |
| 228 | // NO__ERRNO: declare x86_fp80 @fdiml(x86_fp80, x86_fp80) [[READNONE]] |
| 229 | // HAS_ERRNO: declare double @fdim(double, double) [[NOT_READNONE]] |
| 230 | // HAS_ERRNO: declare float @fdimf(float, float) [[NOT_READNONE]] |
| 231 | // HAS_ERRNO: declare x86_fp80 @fdiml(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 232 | |
| 233 | floor(f); floorf(f); floorl(f); |
| 234 | |
| 235 | // NO__ERRNO: declare double @floor(double) [[READNONE]] |
| 236 | // NO__ERRNO: declare float @floorf(float) [[READNONE]] |
| 237 | // NO__ERRNO: declare x86_fp80 @floorl(x86_fp80) [[READNONE]] |
| 238 | // HAS_ERRNO: declare double @floor(double) [[READNONE]] |
| 239 | // HAS_ERRNO: declare float @floorf(float) [[READNONE]] |
| 240 | // HAS_ERRNO: declare x86_fp80 @floorl(x86_fp80) [[READNONE]] |
| 241 | |
| 242 | fma(f,f,f); fmaf(f,f,f); fmal(f,f,f); |
| 243 | |
| 244 | // NO__ERRNO: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC]] |
| 245 | // NO__ERRNO: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]] |
| 246 | // NO__ERRNO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[READNONE_INTRINSIC]] |
| 247 | // HAS_ERRNO: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC:#[0-9]+]] |
| 248 | // HAS_ERRNO: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]] |
| 249 | // HAS_ERRNO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[READNONE_INTRINSIC]] |
| 250 | |
| 251 | fmax(f,f); fmaxf(f,f); fmaxl(f,f); |
| 252 | |
| 253 | // NO__ERRNO: declare double @fmax(double, double) [[READNONE]] |
| 254 | // NO__ERRNO: declare float @fmaxf(float, float) [[READNONE]] |
| 255 | // NO__ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) [[READNONE]] |
| 256 | // HAS_ERRNO: declare double @fmax(double, double) [[READNONE]] |
| 257 | // HAS_ERRNO: declare float @fmaxf(float, float) [[READNONE]] |
| 258 | // HAS_ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) [[READNONE]] |
| 259 | |
| 260 | fmin(f,f); fminf(f,f); fminl(f,f); |
| 261 | |
| 262 | // NO__ERRNO: declare double @fmin(double, double) [[READNONE]] |
| 263 | // NO__ERRNO: declare float @fminf(float, float) [[READNONE]] |
| 264 | // NO__ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[READNONE]] |
| 265 | // HAS_ERRNO: declare double @fmin(double, double) [[READNONE]] |
| 266 | // HAS_ERRNO: declare float @fminf(float, float) [[READNONE]] |
| 267 | // HAS_ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[READNONE]] |
| 268 | |
| 269 | hypot(f,f); hypotf(f,f); hypotl(f,f); |
| 270 | |
| 271 | // NO__ERRNO: declare double @hypot(double, double) [[READNONE]] |
| 272 | // NO__ERRNO: declare float @hypotf(float, float) [[READNONE]] |
| 273 | // NO__ERRNO: declare x86_fp80 @hypotl(x86_fp80, x86_fp80) [[READNONE]] |
| 274 | // HAS_ERRNO: declare double @hypot(double, double) [[NOT_READNONE]] |
| 275 | // HAS_ERRNO: declare float @hypotf(float, float) [[NOT_READNONE]] |
| 276 | // HAS_ERRNO: declare x86_fp80 @hypotl(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 277 | |
| 278 | ilogb(f); ilogbf(f); ilogbl(f); |
| 279 | |
| 280 | // NO__ERRNO: declare i32 @ilogb(double) [[READNONE]] |
| 281 | // NO__ERRNO: declare i32 @ilogbf(float) [[READNONE]] |
| 282 | // NO__ERRNO: declare i32 @ilogbl(x86_fp80) [[READNONE]] |
| 283 | // HAS_ERRNO: declare i32 @ilogb(double) [[NOT_READNONE]] |
| 284 | // HAS_ERRNO: declare i32 @ilogbf(float) [[NOT_READNONE]] |
| 285 | // HAS_ERRNO: declare i32 @ilogbl(x86_fp80) [[NOT_READNONE]] |
| 286 | |
| 287 | lgamma(f); lgammaf(f); lgammal(f); |
| 288 | |
| 289 | // NO__ERRNO: declare double @lgamma(double) [[NOT_READNONE]] |
| 290 | // NO__ERRNO: declare float @lgammaf(float) [[NOT_READNONE]] |
| 291 | // NO__ERRNO: declare x86_fp80 @lgammal(x86_fp80) [[NOT_READNONE]] |
| 292 | // HAS_ERRNO: declare double @lgamma(double) [[NOT_READNONE]] |
| 293 | // HAS_ERRNO: declare float @lgammaf(float) [[NOT_READNONE]] |
| 294 | // HAS_ERRNO: declare x86_fp80 @lgammal(x86_fp80) [[NOT_READNONE]] |
| 295 | |
| 296 | llrint(f); llrintf(f); llrintl(f); |
| 297 | |
| 298 | // NO__ERRNO: declare i64 @llrint(double) [[READNONE]] |
| 299 | // NO__ERRNO: declare i64 @llrintf(float) [[READNONE]] |
| 300 | // NO__ERRNO: declare i64 @llrintl(x86_fp80) [[READNONE]] |
| 301 | // HAS_ERRNO: declare i64 @llrint(double) [[NOT_READNONE]] |
| 302 | // HAS_ERRNO: declare i64 @llrintf(float) [[NOT_READNONE]] |
| 303 | // HAS_ERRNO: declare i64 @llrintl(x86_fp80) [[NOT_READNONE]] |
| 304 | |
| 305 | llround(f); llroundf(f); llroundl(f); |
| 306 | |
| 307 | // NO__ERRNO: declare i64 @llround(double) [[READNONE]] |
| 308 | // NO__ERRNO: declare i64 @llroundf(float) [[READNONE]] |
| 309 | // NO__ERRNO: declare i64 @llroundl(x86_fp80) [[READNONE]] |
| 310 | // HAS_ERRNO: declare i64 @llround(double) [[NOT_READNONE]] |
| 311 | // HAS_ERRNO: declare i64 @llroundf(float) [[NOT_READNONE]] |
| 312 | // HAS_ERRNO: declare i64 @llroundl(x86_fp80) [[NOT_READNONE]] |
| 313 | |
| 314 | log(f); logf(f); logl(f); |
| 315 | |
| 316 | // NO__ERRNO: declare double @log(double) [[READNONE]] |
| 317 | // NO__ERRNO: declare float @logf(float) [[READNONE]] |
| 318 | // NO__ERRNO: declare x86_fp80 @logl(x86_fp80) [[READNONE]] |
| 319 | // HAS_ERRNO: declare double @log(double) [[NOT_READNONE]] |
| 320 | // HAS_ERRNO: declare float @logf(float) [[NOT_READNONE]] |
| 321 | // HAS_ERRNO: declare x86_fp80 @logl(x86_fp80) [[NOT_READNONE]] |
| 322 | |
| 323 | log10(f); log10f(f); log10l(f); |
| 324 | |
| 325 | // NO__ERRNO: declare double @log10(double) [[READNONE]] |
| 326 | // NO__ERRNO: declare float @log10f(float) [[READNONE]] |
| 327 | // NO__ERRNO: declare x86_fp80 @log10l(x86_fp80) [[READNONE]] |
| 328 | // HAS_ERRNO: declare double @log10(double) [[NOT_READNONE]] |
| 329 | // HAS_ERRNO: declare float @log10f(float) [[NOT_READNONE]] |
| 330 | // HAS_ERRNO: declare x86_fp80 @log10l(x86_fp80) [[NOT_READNONE]] |
| 331 | |
| 332 | log1p(f); log1pf(f); log1pl(f); |
| 333 | |
| 334 | // NO__ERRNO: declare double @log1p(double) [[READNONE]] |
| 335 | // NO__ERRNO: declare float @log1pf(float) [[READNONE]] |
| 336 | // NO__ERRNO: declare x86_fp80 @log1pl(x86_fp80) [[READNONE]] |
| 337 | // HAS_ERRNO: declare double @log1p(double) [[NOT_READNONE]] |
| 338 | // HAS_ERRNO: declare float @log1pf(float) [[NOT_READNONE]] |
| 339 | // HAS_ERRNO: declare x86_fp80 @log1pl(x86_fp80) [[NOT_READNONE]] |
| 340 | |
| 341 | log2(f); log2f(f); log2l(f); |
| 342 | |
| 343 | // NO__ERRNO: declare double @log2(double) [[READNONE]] |
| 344 | // NO__ERRNO: declare float @log2f(float) [[READNONE]] |
| 345 | // NO__ERRNO: declare x86_fp80 @log2l(x86_fp80) [[READNONE]] |
| 346 | // HAS_ERRNO: declare double @log2(double) [[NOT_READNONE]] |
| 347 | // HAS_ERRNO: declare float @log2f(float) [[NOT_READNONE]] |
| 348 | // HAS_ERRNO: declare x86_fp80 @log2l(x86_fp80) [[NOT_READNONE]] |
| 349 | |
| 350 | logb(f); logbf(f); logbl(f); |
| 351 | |
| 352 | // NO__ERRNO: declare double @logb(double) [[READNONE]] |
| 353 | // NO__ERRNO: declare float @logbf(float) [[READNONE]] |
| 354 | // NO__ERRNO: declare x86_fp80 @logbl(x86_fp80) [[READNONE]] |
| 355 | // HAS_ERRNO: declare double @logb(double) [[NOT_READNONE]] |
| 356 | // HAS_ERRNO: declare float @logbf(float) [[NOT_READNONE]] |
| 357 | // HAS_ERRNO: declare x86_fp80 @logbl(x86_fp80) [[NOT_READNONE]] |
| 358 | |
| 359 | lrint(f); lrintf(f); lrintl(f); |
| 360 | |
| 361 | // NO__ERRNO: declare i64 @lrint(double) [[READNONE]] |
| 362 | // NO__ERRNO: declare i64 @lrintf(float) [[READNONE]] |
| 363 | // NO__ERRNO: declare i64 @lrintl(x86_fp80) [[READNONE]] |
| 364 | // HAS_ERRNO: declare i64 @lrint(double) [[NOT_READNONE]] |
| 365 | // HAS_ERRNO: declare i64 @lrintf(float) [[NOT_READNONE]] |
| 366 | // HAS_ERRNO: declare i64 @lrintl(x86_fp80) [[NOT_READNONE]] |
| 367 | |
| 368 | lround(f); lroundf(f); lroundl(f); |
| 369 | |
| 370 | // NO__ERRNO: declare i64 @lround(double) [[READNONE]] |
| 371 | // NO__ERRNO: declare i64 @lroundf(float) [[READNONE]] |
| 372 | // NO__ERRNO: declare i64 @lroundl(x86_fp80) [[READNONE]] |
| 373 | // HAS_ERRNO: declare i64 @lround(double) [[NOT_READNONE]] |
| 374 | // HAS_ERRNO: declare i64 @lroundf(float) [[NOT_READNONE]] |
| 375 | // HAS_ERRNO: declare i64 @lroundl(x86_fp80) [[NOT_READNONE]] |
| 376 | |
| 377 | nearbyint(f); nearbyintf(f); nearbyintl(f); |
| 378 | |
| 379 | // NO__ERRNO: declare double @nearbyint(double) [[READNONE]] |
| 380 | // NO__ERRNO: declare float @nearbyintf(float) [[READNONE]] |
| 381 | // NO__ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[READNONE]] |
| 382 | // HAS_ERRNO: declare double @nearbyint(double) [[READNONE]] |
| 383 | // HAS_ERRNO: declare float @nearbyintf(float) [[READNONE]] |
| 384 | // HAS_ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[READNONE]] |
| 385 | |
| 386 | nextafter(f,f); nextafterf(f,f); nextafterl(f,f); |
| 387 | |
| 388 | // NO__ERRNO: declare double @nextafter(double, double) [[READNONE]] |
| 389 | // NO__ERRNO: declare float @nextafterf(float, float) [[READNONE]] |
| 390 | // NO__ERRNO: declare x86_fp80 @nextafterl(x86_fp80, x86_fp80) [[READNONE]] |
| 391 | // HAS_ERRNO: declare double @nextafter(double, double) [[NOT_READNONE]] |
| 392 | // HAS_ERRNO: declare float @nextafterf(float, float) [[NOT_READNONE]] |
| 393 | // HAS_ERRNO: declare x86_fp80 @nextafterl(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 394 | |
| 395 | nexttoward(f,f); nexttowardf(f,f);nexttowardl(f,f); |
| 396 | |
| 397 | // NO__ERRNO: declare double @nexttoward(double, x86_fp80) [[READNONE]] |
| 398 | // NO__ERRNO: declare float @nexttowardf(float, x86_fp80) [[READNONE]] |
| 399 | // NO__ERRNO: declare x86_fp80 @nexttowardl(x86_fp80, x86_fp80) [[READNONE]] |
| 400 | // HAS_ERRNO: declare double @nexttoward(double, x86_fp80) [[NOT_READNONE]] |
| 401 | // HAS_ERRNO: declare float @nexttowardf(float, x86_fp80) [[NOT_READNONE]] |
| 402 | // HAS_ERRNO: declare x86_fp80 @nexttowardl(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 403 | |
| 404 | remainder(f,f); remainderf(f,f); remainderl(f,f); |
| 405 | |
| 406 | // NO__ERRNO: declare double @remainder(double, double) [[READNONE]] |
| 407 | // NO__ERRNO: declare float @remainderf(float, float) [[READNONE]] |
| 408 | // NO__ERRNO: declare x86_fp80 @remainderl(x86_fp80, x86_fp80) [[READNONE]] |
| 409 | // HAS_ERRNO: declare double @remainder(double, double) [[NOT_READNONE]] |
| 410 | // HAS_ERRNO: declare float @remainderf(float, float) [[NOT_READNONE]] |
| 411 | // HAS_ERRNO: declare x86_fp80 @remainderl(x86_fp80, x86_fp80) [[NOT_READNONE]] |
| 412 | |
Sanjay Patel | c919758 | 2017-11-04 15:03:11 +0000 | [diff] [blame] | 413 | remquo(f,f,i); remquof(f,f,i); remquol(f,f,i); |
| 414 | |
| 415 | // NO__ERRNO: declare double @remquo(double, double, i32*) [[NOT_READNONE]] |
| 416 | // NO__ERRNO: declare float @remquof(float, float, i32*) [[NOT_READNONE]] |
| 417 | // NO__ERRNO: declare x86_fp80 @remquol(x86_fp80, x86_fp80, i32*) [[NOT_READNONE]] |
| 418 | // HAS_ERRNO: declare double @remquo(double, double, i32*) [[NOT_READNONE]] |
| 419 | // HAS_ERRNO: declare float @remquof(float, float, i32*) [[NOT_READNONE]] |
| 420 | // HAS_ERRNO: declare x86_fp80 @remquol(x86_fp80, x86_fp80, i32*) [[NOT_READNONE]] |
Sanjay Patel | 594d217 | 2017-11-03 16:27:27 +0000 | [diff] [blame] | 421 | |
| 422 | rint(f); rintf(f); rintl(f); |
| 423 | |
| 424 | // NO__ERRNO: declare double @rint(double) [[READNONE]] |
| 425 | // NO__ERRNO: declare float @rintf(float) [[READNONE]] |
| 426 | // NO__ERRNO: declare x86_fp80 @rintl(x86_fp80) [[READNONE]] |
| 427 | // HAS_ERRNO: declare double @rint(double) [[READNONE]] |
| 428 | // HAS_ERRNO: declare float @rintf(float) [[READNONE]] |
| 429 | // HAS_ERRNO: declare x86_fp80 @rintl(x86_fp80) [[READNONE]] |
| 430 | |
| 431 | round(f); roundf(f); roundl(f); |
| 432 | |
| 433 | // NO__ERRNO: declare double @round(double) [[READNONE]] |
| 434 | // NO__ERRNO: declare float @roundf(float) [[READNONE]] |
| 435 | // NO__ERRNO: declare x86_fp80 @roundl(x86_fp80) [[READNONE]] |
| 436 | // HAS_ERRNO: declare double @round(double) [[READNONE]] |
| 437 | // HAS_ERRNO: declare float @roundf(float) [[READNONE]] |
| 438 | // HAS_ERRNO: declare x86_fp80 @roundl(x86_fp80) [[READNONE]] |
| 439 | |
| 440 | scalbln(f,f); scalblnf(f,f); scalblnl(f,f); |
| 441 | |
| 442 | // NO__ERRNO: declare double @scalbln(double, i64) [[READNONE]] |
| 443 | // NO__ERRNO: declare float @scalblnf(float, i64) [[READNONE]] |
| 444 | // NO__ERRNO: declare x86_fp80 @scalblnl(x86_fp80, i64) [[READNONE]] |
| 445 | // HAS_ERRNO: declare double @scalbln(double, i64) [[NOT_READNONE]] |
| 446 | // HAS_ERRNO: declare float @scalblnf(float, i64) [[NOT_READNONE]] |
| 447 | // HAS_ERRNO: declare x86_fp80 @scalblnl(x86_fp80, i64) [[NOT_READNONE]] |
| 448 | |
| 449 | scalbn(f,f); scalbnf(f,f); scalbnl(f,f); |
| 450 | |
| 451 | // NO__ERRNO: declare double @scalbn(double, i32) [[READNONE]] |
| 452 | // NO__ERRNO: declare float @scalbnf(float, i32) [[READNONE]] |
| 453 | // NO__ERRNO: declare x86_fp80 @scalbnl(x86_fp80, i32) [[READNONE]] |
| 454 | // HAS_ERRNO: declare double @scalbn(double, i32) [[NOT_READNONE]] |
| 455 | // HAS_ERRNO: declare float @scalbnf(float, i32) [[NOT_READNONE]] |
| 456 | // HAS_ERRNO: declare x86_fp80 @scalbnl(x86_fp80, i32) [[NOT_READNONE]] |
| 457 | |
| 458 | sin(f); sinf(f); sinl(f); |
| 459 | |
| 460 | // NO__ERRNO: declare double @sin(double) [[READNONE]] |
| 461 | // NO__ERRNO: declare float @sinf(float) [[READNONE]] |
| 462 | // NO__ERRNO: declare x86_fp80 @sinl(x86_fp80) [[READNONE]] |
| 463 | // HAS_ERRNO: declare double @sin(double) [[NOT_READNONE]] |
| 464 | // HAS_ERRNO: declare float @sinf(float) [[NOT_READNONE]] |
| 465 | // HAS_ERRNO: declare x86_fp80 @sinl(x86_fp80) [[NOT_READNONE]] |
| 466 | |
| 467 | sinh(f); sinhf(f); sinhl(f); |
| 468 | |
| 469 | // NO__ERRNO: declare double @sinh(double) [[READNONE]] |
| 470 | // NO__ERRNO: declare float @sinhf(float) [[READNONE]] |
| 471 | // NO__ERRNO: declare x86_fp80 @sinhl(x86_fp80) [[READNONE]] |
| 472 | // HAS_ERRNO: declare double @sinh(double) [[NOT_READNONE]] |
| 473 | // HAS_ERRNO: declare float @sinhf(float) [[NOT_READNONE]] |
| 474 | // HAS_ERRNO: declare x86_fp80 @sinhl(x86_fp80) [[NOT_READNONE]] |
| 475 | |
| 476 | sqrt(f); sqrtf(f); sqrtl(f); |
| 477 | |
| 478 | // NO__ERRNO: declare double @llvm.sqrt.f64(double) [[READNONE_INTRINSIC]] |
| 479 | // NO__ERRNO: declare float @llvm.sqrt.f32(float) [[READNONE_INTRINSIC]] |
| 480 | // NO__ERRNO: declare x86_fp80 @llvm.sqrt.f80(x86_fp80) [[READNONE_INTRINSIC]] |
| 481 | // HAS_ERRNO: declare double @sqrt(double) [[NOT_READNONE]] |
| 482 | // HAS_ERRNO: declare float @sqrtf(float) [[NOT_READNONE]] |
| 483 | // HAS_ERRNO: declare x86_fp80 @sqrtl(x86_fp80) [[NOT_READNONE]] |
| 484 | |
| 485 | tan(f); tanf(f); tanl(f); |
| 486 | |
| 487 | // NO__ERRNO: declare double @tan(double) [[READNONE]] |
| 488 | // NO__ERRNO: declare float @tanf(float) [[READNONE]] |
| 489 | // NO__ERRNO: declare x86_fp80 @tanl(x86_fp80) [[READNONE]] |
| 490 | // HAS_ERRNO: declare double @tan(double) [[NOT_READNONE]] |
| 491 | // HAS_ERRNO: declare float @tanf(float) [[NOT_READNONE]] |
| 492 | // HAS_ERRNO: declare x86_fp80 @tanl(x86_fp80) [[NOT_READNONE]] |
| 493 | |
| 494 | tanh(f); tanhf(f); tanhl(f); |
| 495 | |
| 496 | // NO__ERRNO: declare double @tanh(double) [[READNONE]] |
| 497 | // NO__ERRNO: declare float @tanhf(float) [[READNONE]] |
| 498 | // NO__ERRNO: declare x86_fp80 @tanhl(x86_fp80) [[READNONE]] |
| 499 | // HAS_ERRNO: declare double @tanh(double) [[NOT_READNONE]] |
| 500 | // HAS_ERRNO: declare float @tanhf(float) [[NOT_READNONE]] |
| 501 | // HAS_ERRNO: declare x86_fp80 @tanhl(x86_fp80) [[NOT_READNONE]] |
| 502 | |
| 503 | tgamma(f); tgammaf(f); tgammal(f); |
| 504 | |
| 505 | // NO__ERRNO: declare double @tgamma(double) [[READNONE]] |
| 506 | // NO__ERRNO: declare float @tgammaf(float) [[READNONE]] |
| 507 | // NO__ERRNO: declare x86_fp80 @tgammal(x86_fp80) [[READNONE]] |
| 508 | // HAS_ERRNO: declare double @tgamma(double) [[NOT_READNONE]] |
| 509 | // HAS_ERRNO: declare float @tgammaf(float) [[NOT_READNONE]] |
| 510 | // HAS_ERRNO: declare x86_fp80 @tgammal(x86_fp80) [[NOT_READNONE]] |
| 511 | |
| 512 | trunc(f); truncf(f); truncl(f); |
| 513 | |
| 514 | // NO__ERRNO: declare double @trunc(double) [[READNONE]] |
| 515 | // NO__ERRNO: declare float @truncf(float) [[READNONE]] |
| 516 | // NO__ERRNO: declare x86_fp80 @truncl(x86_fp80) [[READNONE]] |
| 517 | // HAS_ERRNO: declare double @trunc(double) [[READNONE]] |
| 518 | // HAS_ERRNO: declare float @truncf(float) [[READNONE]] |
| 519 | // HAS_ERRNO: declare x86_fp80 @truncl(x86_fp80) [[READNONE]] |
Sanjay Patel | 594d217 | 2017-11-03 16:27:27 +0000 | [diff] [blame] | 520 | }; |
| 521 | |
| 522 | |
| 523 | // NO__ERRNO: attributes [[READNONE]] = { {{.*}}readnone{{.*}} } |
| 524 | // NO__ERRNO: attributes [[NOT_READNONE]] = { nounwind "correctly{{.*}} } |
| 525 | // NO__ERRNO: attributes [[READONLY]] = { {{.*}}readonly{{.*}} } |
| 526 | // NO__ERRNO: attributes [[READNONE_INTRINSIC]] = { {{.*}}readnone{{.*}} } |
| 527 | |
| 528 | // HAS_ERRNO: attributes [[NOT_READNONE]] = { nounwind "correctly{{.*}} } |
| 529 | // HAS_ERRNO: attributes [[READNONE]] = { {{.*}}readnone{{.*}} } |
| 530 | // HAS_ERRNO: attributes [[READONLY]] = { {{.*}}readonly{{.*}} } |
| 531 | // HAS_ERRNO: attributes [[READNONE_INTRINSIC]] = { {{.*}}readnone{{.*}} } |
| 532 | |