750 lines · c
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-implicit-function-declaration -w -o - -emit-llvm %s | FileCheck %s --check-prefixes=COMMON,NO__ERRNO2// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-implicit-function-declaration -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefixes=COMMON,HAS_ERRNO3// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-implicit-function-declaration -w -o - -emit-llvm -disable-llvm-passes -O2 %s | FileCheck %s --check-prefixes=COMMON,NO__ERRNO4// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-implicit-function-declaration -w -o - -emit-llvm -disable-llvm-passes -O2 -fmath-errno %s | FileCheck %s --check-prefixes=COMMON,HAS_ERRNO5// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-implicit-function-declaration -w -o - -emit-llvm -ffp-exception-behavior=maytrap %s | FileCheck %s --check-prefixes=COMMON,HAS_MAYTRAP6// RUN: %clang_cc1 -triple x86_64-unknown-unknown-gnu -Wno-implicit-function-declaration -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_GNU7// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -Wno-implicit-function-declaration -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_WIN8 9// Test attributes and builtin codegen of math library calls.10 11void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {12 f = fmod(f,f); f = fmodf(f,f); f = fmodl(f,f);13 14 // NO__ERRNO: frem double15 // NO__ERRNO: frem float16 // NO__ERRNO: frem x86_fp8017 // HAS_ERRNO: declare double @fmod(double noundef, double noundef) [[NOT_READNONE:#[0-9]+]]18 // HAS_ERRNO: declare float @fmodf(float noundef, float noundef) [[NOT_READNONE]]19 // HAS_ERRNO: declare x86_fp80 @fmodl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]20 // HAS_MAYTRAP: declare double @llvm.experimental.constrained.frem.f64(21 // HAS_MAYTRAP: declare float @llvm.experimental.constrained.frem.f32(22 // HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.frem.f80(23 24 atan2(f,f); atan2f(f,f) ; atan2l(f, f);25 26 // NO__ERRNO: declare double @llvm.atan2.f64(double, double) [[READNONE_INTRINSIC:#[0-9]+]]27 // NO__ERRNO: declare float @llvm.atan2.f32(float, float) [[READNONE_INTRINSIC]]28 // NO__ERRNO: declare x86_fp80 @llvm.atan2.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]29 // HAS_ERRNO: declare double @atan2(double noundef, double noundef) [[NOT_READNONE]]30 // HAS_ERRNO: declare float @atan2f(float noundef, float noundef) [[NOT_READNONE]]31 // HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]32 // HAS_MAYTRAP: declare double @llvm.experimental.constrained.atan2.f64(33 // HAS_MAYTRAP: declare float @llvm.experimental.constrained.atan2.f32(34 // HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.atan2.f80(35 36 copysign(f,f); copysignf(f,f);copysignl(f,f);37 38 // NO__ERRNO: declare double @llvm.copysign.f64(double, double) [[READNONE_INTRINSIC2:#[0-9]+]]39 // NO__ERRNO: declare float @llvm.copysign.f32(float, float) [[READNONE_INTRINSIC2]]40 // NO__ERRNO: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]41 // HAS_ERRNO: declare double @llvm.copysign.f64(double, double) [[READNONE_INTRINSIC2:#[0-9]+]]42 // HAS_ERRNO: declare float @llvm.copysign.f32(float, float) [[READNONE_INTRINSIC2]]43 // HAS_ERRNO: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]44 // HAS_MAYTRAP: declare double @llvm.copysign.f64(double, double) [[READNONE_INTRINSIC2:#[0-9]+]]45 // HAS_MAYTRAP: declare float @llvm.copysign.f32(float, float) [[READNONE_INTRINSIC2]]46 // HAS_MAYTRAP: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]47 48 fabs(f); fabsf(f); fabsl(f);49 50 // NO__ERRNO: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC2]]51 // NO__ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC2]]52 // NO__ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC2]]53 // HAS_ERRNO: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC2]]54 // HAS_ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC2]]55 // HAS_ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC2]]56 // HAS_MAYTRAP: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC2]]57 // HAS_MAYTRAP: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC2]]58 // HAS_MAYTRAP: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC2]]59 60 frexp(f,i); frexpf(f,i); frexpl(f,i);61 62 // NO__ERRNO: declare double @frexp(double noundef, ptr noundef) [[NOT_READNONE:#[0-9]+]]63 // NO__ERRNO: declare float @frexpf(float noundef, ptr noundef) [[NOT_READNONE]]64 // NO__ERRNO: declare x86_fp80 @frexpl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]65 // HAS_ERRNO: declare double @frexp(double noundef, ptr noundef) [[NOT_READNONE]]66 // HAS_ERRNO: declare float @frexpf(float noundef, ptr noundef) [[NOT_READNONE]]67 // HAS_ERRNO: declare x86_fp80 @frexpl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]68 // HAS_MAYTRAP: declare double @frexp(double noundef, ptr noundef) [[NOT_READNONE:#[0-9]+]]69 // HAS_MAYTRAP: declare float @frexpf(float noundef, ptr noundef) [[NOT_READNONE]]70 // HAS_MAYTRAP: declare x86_fp80 @frexpl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]71 72 ldexp(f,f); ldexpf(f,f); ldexpl(f,f);73 74 // NO__ERRNO: declare double @ldexp(double noundef, i32 noundef) [[READNONE:#[0-9]+]]75 // NO__ERRNO: declare float @ldexpf(float noundef, i32 noundef) [[READNONE]]76 // NO__ERRNO: declare x86_fp80 @ldexpl(x86_fp80 noundef, i32 noundef) [[READNONE]]77 // HAS_ERRNO: declare double @ldexp(double noundef, i32 noundef) [[NOT_READNONE]]78 // HAS_ERRNO: declare float @ldexpf(float noundef, i32 noundef) [[NOT_READNONE]]79 // HAS_ERRNO: declare x86_fp80 @ldexpl(x86_fp80 noundef, i32 noundef) [[NOT_READNONE]]80 // HAS_MAYTRAP: declare double @ldexp(double noundef, i32 noundef) [[NOT_READNONE]]81 // HAS_MAYTRAP: declare float @ldexpf(float noundef, i32 noundef) [[NOT_READNONE]]82 // HAS_MAYTRAP: declare x86_fp80 @ldexpl(x86_fp80 noundef, i32 noundef) [[NOT_READNONE]]83 84 modf(f,d); modff(f,fp); modfl(f,l);85 86 // NO__ERRNO: declare { double, double } @llvm.modf.f64(double) [[READNONE_INTRINSIC]]87 // NO__ERRNO: declare { float, float } @llvm.modf.f32(float) [[READNONE_INTRINSIC]]88 // NO__ERRNO: declare { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80) [[READNONE_INTRINSIC]]89 // HAS_ERRNO: declare { double, double } @llvm.modf.f64(double) [[READNONE_INTRINSIC:#[0-9]+]]90 // HAS_ERRNO: declare { float, float } @llvm.modf.f32(float) [[READNONE_INTRINSIC]]91 // HAS_ERRNO: declare { x86_fp80, x86_fp80 } @llvm.modf.f80(x86_fp80) [[READNONE_INTRINSIC]]92 // HAS_MAYTRAP: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE]]93 // HAS_MAYTRAP: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]94 // HAS_MAYTRAP: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]95 96 nan(c); nanf(c); nanl(c);97 98// NO__ERRNO: declare double @nan(ptr noundef) [[READONLY:#[0-9]+]]99// NO__ERRNO: declare float @nanf(ptr noundef) [[READONLY]]100// NO__ERRNO: declare x86_fp80 @nanl(ptr noundef) [[READONLY]]101// HAS_ERRNO: declare double @nan(ptr noundef) [[READONLY:#[0-9]+]]102// HAS_ERRNO: declare float @nanf(ptr noundef) [[READONLY]]103// HAS_ERRNO: declare x86_fp80 @nanl(ptr noundef) [[READONLY]]104// HAS_MAYTRAP: declare double @nan(ptr noundef) [[READONLY:#[0-9]+]]105// HAS_MAYTRAP: declare float @nanf(ptr noundef) [[READONLY]]106// HAS_MAYTRAP: declare x86_fp80 @nanl(ptr noundef) [[READONLY]]107 108 pow(f,f); powf(f,f); powl(f,f);109 110// NO__ERRNO: declare double @llvm.pow.f64(double, double) [[READNONE_INTRINSIC2]]111// NO__ERRNO: declare float @llvm.pow.f32(float, float) [[READNONE_INTRINSIC2]]112// NO__ERRNO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]113// HAS_ERRNO: declare double @pow(double noundef, double noundef) [[NOT_READNONE]]114// HAS_ERRNO: declare float @powf(float noundef, float noundef) [[NOT_READNONE]]115// HAS_ERRNO: declare x86_fp80 @powl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]116// HAS_MAYTRAP: declare double @llvm.experimental.constrained.pow.f64(117// HAS_MAYTRAP: declare float @llvm.experimental.constrained.pow.f32(118// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.pow.f80({{.*}})119 120 121 /* math */122 acos(f); acosf(f); acosl(f);123 124// NO__ERRNO: declare double @llvm.acos.f64(double) [[READNONE_INTRINSIC]]125// NO__ERRNO: declare float @llvm.acos.f32(float) [[READNONE_INTRINSIC]]126// NO__ERRNO: declare x86_fp80 @llvm.acos.f80(x86_fp80) [[READNONE_INTRINSIC]]127// HAS_ERRNO: declare double @acos(double noundef) [[NOT_READNONE]]128// HAS_ERRNO: declare float @acosf(float noundef) [[NOT_READNONE]]129// HAS_ERRNO: declare x86_fp80 @acosl(x86_fp80 noundef) [[NOT_READNONE]]130// HAS_MAYTRAP: declare double @llvm.experimental.constrained.acos.f64(131// HAS_MAYTRAP: declare float @llvm.experimental.constrained.acos.f32(132// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.acos.f80(133 134 135 acosh(f); acoshf(f); acoshl(f);136 137// NO__ERRNO: declare double @acosh(double noundef) [[READNONE]]138// NO__ERRNO: declare float @acoshf(float noundef) [[READNONE]]139// NO__ERRNO: declare x86_fp80 @acoshl(x86_fp80 noundef) [[READNONE]]140// HAS_ERRNO: declare double @acosh(double noundef) [[NOT_READNONE]]141// HAS_ERRNO: declare float @acoshf(float noundef) [[NOT_READNONE]]142// HAS_ERRNO: declare x86_fp80 @acoshl(x86_fp80 noundef) [[NOT_READNONE]]143// HAS_MAYTRAP: declare double @acosh(double noundef) [[NOT_READNONE]]144// HAS_MAYTRAP: declare float @acoshf(float noundef) [[NOT_READNONE]]145// HAS_MAYTRAP: declare x86_fp80 @acoshl(x86_fp80 noundef) [[NOT_READNONE]]146 147 asin(f); asinf(f); asinl(f);148 149// NO__ERRNO: declare double @llvm.asin.f64(double) [[READNONE_INTRINSIC]]150// NO__ERRNO: declare float @llvm.asin.f32(float) [[READNONE_INTRINSIC]]151// NO__ERRNO: declare x86_fp80 @llvm.asin.f80(x86_fp80) [[READNONE_INTRINSIC]]152// HAS_ERRNO: declare double @asin(double noundef) [[NOT_READNONE]]153// HAS_ERRNO: declare float @asinf(float noundef) [[NOT_READNONE]]154// HAS_ERRNO: declare x86_fp80 @asinl(x86_fp80 noundef) [[NOT_READNONE]]155// HAS_MAYTRAP: declare double @llvm.experimental.constrained.asin.f64(156// HAS_MAYTRAP: declare float @llvm.experimental.constrained.asin.f32(157// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.asin.f80(158 159 asinh(f); asinhf(f); asinhl(f);160 161// NO__ERRNO: declare double @asinh(double noundef) [[READNONE]]162// NO__ERRNO: declare float @asinhf(float noundef) [[READNONE]]163// NO__ERRNO: declare x86_fp80 @asinhl(x86_fp80 noundef) [[READNONE]]164// HAS_ERRNO: declare double @asinh(double noundef) [[NOT_READNONE]]165// HAS_ERRNO: declare float @asinhf(float noundef) [[NOT_READNONE]]166// HAS_ERRNO: declare x86_fp80 @asinhl(x86_fp80 noundef) [[NOT_READNONE]]167// HAS_MAYTRAP: declare double @asinh(double noundef) [[NOT_READNONE]]168// HAS_MAYTRAP: declare float @asinhf(float noundef) [[NOT_READNONE]]169// HAS_MAYTRAP: declare x86_fp80 @asinhl(x86_fp80 noundef) [[NOT_READNONE]]170 171 atan(f); atanf(f); atanl(f);172 173// NO__ERRNO: declare double @llvm.atan.f64(double) [[READNONE_INTRINSIC]]174// NO__ERRNO: declare float @llvm.atan.f32(float) [[READNONE_INTRINSIC]]175// NO__ERRNO: declare x86_fp80 @llvm.atan.f80(x86_fp80) [[READNONE_INTRINSIC]]176// HAS_ERRNO: declare double @atan(double noundef) [[NOT_READNONE]]177// HAS_ERRNO: declare float @atanf(float noundef) [[NOT_READNONE]]178// HAS_ERRNO: declare x86_fp80 @atanl(x86_fp80 noundef) [[NOT_READNONE]]179// HAS_MAYTRAP: declare double @llvm.experimental.constrained.atan.f64(180// HAS_MAYTRAP: declare float @llvm.experimental.constrained.atan.f32(181// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.atan.f80(182 183 atanh(f); atanhf(f); atanhl(f);184 185// NO__ERRNO: declare double @atanh(double noundef) [[READNONE]]186// NO__ERRNO: declare float @atanhf(float noundef) [[READNONE]]187// NO__ERRNO: declare x86_fp80 @atanhl(x86_fp80 noundef) [[READNONE]]188// HAS_ERRNO: declare double @atanh(double noundef) [[NOT_READNONE]]189// HAS_ERRNO: declare float @atanhf(float noundef) [[NOT_READNONE]]190// HAS_ERRNO: declare x86_fp80 @atanhl(x86_fp80 noundef) [[NOT_READNONE]]191// HAS_MAYTRAP: declare double @atanh(double noundef) [[NOT_READNONE]]192// HAS_MAYTRAP: declare float @atanhf(float noundef) [[NOT_READNONE]]193// HAS_MAYTRAP: declare x86_fp80 @atanhl(x86_fp80 noundef) [[NOT_READNONE]]194 195 cbrt(f); cbrtf(f); cbrtl(f);196 197// NO__ERRNO: declare double @cbrt(double noundef) [[READNONE]]198// NO__ERRNO: declare float @cbrtf(float noundef) [[READNONE]]199// NO__ERRNO: declare x86_fp80 @cbrtl(x86_fp80 noundef) [[READNONE]]200// HAS_ERRNO: declare double @cbrt(double noundef) [[READNONE:#[0-9]+]]201// HAS_ERRNO: declare float @cbrtf(float noundef) [[READNONE]]202// HAS_ERRNO: declare x86_fp80 @cbrtl(x86_fp80 noundef) [[READNONE]]203// HAS_MAYTRAP: declare double @cbrt(double noundef) [[READNONE:#[0-9]+]]204// HAS_MAYTRAP: declare float @cbrtf(float noundef) [[READNONE]]205// HAS_MAYTRAP: declare x86_fp80 @cbrtl(x86_fp80 noundef) [[READNONE]]206 207 ceil(f); ceilf(f); ceill(f);208 209// NO__ERRNO: declare double @llvm.ceil.f64(double) [[READNONE_INTRINSIC2]]210// NO__ERRNO: declare float @llvm.ceil.f32(float) [[READNONE_INTRINSIC2]]211// NO__ERRNO: declare x86_fp80 @llvm.ceil.f80(x86_fp80) [[READNONE_INTRINSIC2]]212// HAS_ERRNO: declare double @llvm.ceil.f64(double) [[READNONE_INTRINSIC2]]213// HAS_ERRNO: declare float @llvm.ceil.f32(float) [[READNONE_INTRINSIC2]]214// HAS_ERRNO: declare x86_fp80 @llvm.ceil.f80(x86_fp80) [[READNONE_INTRINSIC2]]215// HAS_MAYTRAP: declare double @llvm.experimental.constrained.ceil.f64(216// HAS_MAYTRAP: declare float @llvm.experimental.constrained.ceil.f32(217// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.ceil.f80(218 219 cos(f); cosf(f); cosl(f);220 221// NO__ERRNO: declare double @llvm.cos.f64(double) [[READNONE_INTRINSIC2]]222// NO__ERRNO: declare float @llvm.cos.f32(float) [[READNONE_INTRINSIC2]]223// NO__ERRNO: declare x86_fp80 @llvm.cos.f80(x86_fp80) [[READNONE_INTRINSIC2]]224// HAS_ERRNO: declare double @cos(double noundef) [[NOT_READNONE]]225// HAS_ERRNO: declare float @cosf(float noundef) [[NOT_READNONE]]226// HAS_ERRNO: declare x86_fp80 @cosl(x86_fp80 noundef) [[NOT_READNONE]]227// HAS_MAYTRAP: declare double @llvm.experimental.constrained.cos.f64(228// HAS_MAYTRAP: declare float @llvm.experimental.constrained.cos.f32(229// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.cos.f80(230 231 cosh(f); coshf(f); coshl(f);232 233// NO__ERRNO: declare double @llvm.cosh.f64(double) [[READNONE_INTRINSIC]]234// NO__ERRNO: declare float @llvm.cosh.f32(float) [[READNONE_INTRINSIC]]235// NO__ERRNO: declare x86_fp80 @llvm.cosh.f80(x86_fp80) [[READNONE_INTRINSIC]]236// HAS_ERRNO: declare double @cosh(double noundef) [[NOT_READNONE]]237// HAS_ERRNO: declare float @coshf(float noundef) [[NOT_READNONE]]238// HAS_ERRNO: declare x86_fp80 @coshl(x86_fp80 noundef) [[NOT_READNONE]]239// HAS_MAYTRAP: declare double @llvm.experimental.constrained.cosh.f64(240// HAS_MAYTRAP: declare float @llvm.experimental.constrained.cosh.f32(241// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.cosh.f80(242 243 erf(f); erff(f); erfl(f);244 245// NO__ERRNO: declare double @erf(double noundef) [[READNONE]]246// NO__ERRNO: declare float @erff(float noundef) [[READNONE]]247// NO__ERRNO: declare x86_fp80 @erfl(x86_fp80 noundef) [[READNONE]]248// HAS_ERRNO: declare double @erf(double noundef) [[NOT_READNONE]]249// HAS_ERRNO: declare float @erff(float noundef) [[NOT_READNONE]]250// HAS_ERRNO: declare x86_fp80 @erfl(x86_fp80 noundef) [[NOT_READNONE]]251// HAS_MAYTRAP: declare double @erf(double noundef) [[NOT_READNONE]]252// HAS_MAYTRAP: declare float @erff(float noundef) [[NOT_READNONE]]253// HAS_MAYTRAP: declare x86_fp80 @erfl(x86_fp80 noundef) [[NOT_READNONE]]254 255 erfc(f); erfcf(f); erfcl(f);256 257// NO__ERRNO: declare double @erfc(double noundef) [[READNONE]]258// NO__ERRNO: declare float @erfcf(float noundef) [[READNONE]]259// NO__ERRNO: declare x86_fp80 @erfcl(x86_fp80 noundef) [[READNONE]]260// HAS_ERRNO: declare double @erfc(double noundef) [[NOT_READNONE]]261// HAS_ERRNO: declare float @erfcf(float noundef) [[NOT_READNONE]]262// HAS_ERRNO: declare x86_fp80 @erfcl(x86_fp80 noundef) [[NOT_READNONE]]263// HAS_MAYTRAP: declare double @erfc(double noundef) [[NOT_READNONE]]264// HAS_MAYTRAP: declare float @erfcf(float noundef) [[NOT_READNONE]]265// HAS_MAYTRAP: declare x86_fp80 @erfcl(x86_fp80 noundef) [[NOT_READNONE]]266 267 exp(f); expf(f); expl(f);268 269// NO__ERRNO: declare double @llvm.exp.f64(double) [[READNONE_INTRINSIC2]]270// NO__ERRNO: declare float @llvm.exp.f32(float) [[READNONE_INTRINSIC2]]271// NO__ERRNO: declare x86_fp80 @llvm.exp.f80(x86_fp80) [[READNONE_INTRINSIC2]]272// HAS_ERRNO: declare double @exp(double noundef) [[NOT_READNONE]]273// HAS_ERRNO: declare float @expf(float noundef) [[NOT_READNONE]]274// HAS_ERRNO: declare x86_fp80 @expl(x86_fp80 noundef) [[NOT_READNONE]]275// HAS_MAYTRAP: declare double @llvm.experimental.constrained.exp.f64(276// HAS_MAYTRAP: declare float @llvm.experimental.constrained.exp.f32(277// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.exp.f80(278 279 exp2(f); exp2f(f); exp2l(f);280 281// NO__ERRNO: declare double @llvm.exp2.f64(double) [[READNONE_INTRINSIC2]]282// NO__ERRNO: declare float @llvm.exp2.f32(float) [[READNONE_INTRINSIC2]]283// NO__ERRNO: declare x86_fp80 @llvm.exp2.f80(x86_fp80) [[READNONE_INTRINSIC2]]284// HAS_ERRNO: declare double @exp2(double noundef) [[NOT_READNONE]]285// HAS_ERRNO: declare float @exp2f(float noundef) [[NOT_READNONE]]286// HAS_ERRNO: declare x86_fp80 @exp2l(x86_fp80 noundef) [[NOT_READNONE]]287// HAS_MAYTRAP: declare double @llvm.experimental.constrained.exp2.f64(288// HAS_MAYTRAP: declare float @llvm.experimental.constrained.exp2.f32(289// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.exp2.f80(290 291 expm1(f); expm1f(f); expm1l(f);292 293// NO__ERRNO: declare double @expm1(double noundef) [[READNONE]]294// NO__ERRNO: declare float @expm1f(float noundef) [[READNONE]]295// NO__ERRNO: declare x86_fp80 @expm1l(x86_fp80 noundef) [[READNONE]]296// HAS_ERRNO: declare double @expm1(double noundef) [[NOT_READNONE]]297// HAS_ERRNO: declare float @expm1f(float noundef) [[NOT_READNONE]]298// HAS_ERRNO: declare x86_fp80 @expm1l(x86_fp80 noundef) [[NOT_READNONE]]299// HAS_MAYTRAP: declare double @expm1(double noundef) [[NOT_READNONE]]300// HAS_MAYTRAP: declare float @expm1f(float noundef) [[NOT_READNONE]]301// HAS_MAYTRAP: declare x86_fp80 @expm1l(x86_fp80 noundef) [[NOT_READNONE]]302 303 fdim(f,f); fdimf(f,f); fdiml(f,f);304 305// NO__ERRNO: declare double @fdim(double noundef, double noundef) [[READNONE]]306// NO__ERRNO: declare float @fdimf(float noundef, float noundef) [[READNONE]]307// NO__ERRNO: declare x86_fp80 @fdiml(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]308// HAS_ERRNO: declare double @fdim(double noundef, double noundef) [[NOT_READNONE]]309// HAS_ERRNO: declare float @fdimf(float noundef, float noundef) [[NOT_READNONE]]310// HAS_ERRNO: declare x86_fp80 @fdiml(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]311// HAS_MAYTRAP: declare double @fdim(double noundef, double noundef) [[NOT_READNONE]]312// HAS_MAYTRAP: declare float @fdimf(float noundef, float noundef) [[NOT_READNONE]]313// HAS_MAYTRAP: declare x86_fp80 @fdiml(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]314 315 floor(f); floorf(f); floorl(f);316 317// NO__ERRNO: declare double @llvm.floor.f64(double) [[READNONE_INTRINSIC2]]318// NO__ERRNO: declare float @llvm.floor.f32(float) [[READNONE_INTRINSIC2]]319// NO__ERRNO: declare x86_fp80 @llvm.floor.f80(x86_fp80) [[READNONE_INTRINSIC2]]320// HAS_ERRNO: declare double @llvm.floor.f64(double) [[READNONE_INTRINSIC2]]321// HAS_ERRNO: declare float @llvm.floor.f32(float) [[READNONE_INTRINSIC2]]322// HAS_ERRNO: declare x86_fp80 @llvm.floor.f80(x86_fp80) [[READNONE_INTRINSIC2]]323// HAS_MAYTRAP: declare double @llvm.experimental.constrained.floor.f64324// HAS_MAYTRAP: declare float @llvm.experimental.constrained.floor.f32(325// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.floor.f80(326 327 fma(f,f,f); fmaf(f,f,f); fmal(f,f,f);328 329// NO__ERRNO: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC2]]330// NO__ERRNO: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC2]]331// NO__ERRNO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]332// HAS_ERRNO: declare double @fma(double noundef, double noundef, double noundef) [[NOT_READNONE]]333// HAS_ERRNO: declare float @fmaf(float noundef, float noundef, float noundef) [[NOT_READNONE]]334// HAS_ERRNO: declare x86_fp80 @fmal(x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]335 336// On GNU or Win, fma never sets errno, so we can convert to the intrinsic.337 338// HAS_ERRNO_GNU: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC:#[0-9]+]]339// HAS_ERRNO_GNU: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]]340// HAS_ERRNO_GNU: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]341 342// HAS_ERRNO_WIN: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC:#[0-9]+]]343// HAS_ERRNO_WIN: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]]344// Long double is just double on win, so no f80 use/declaration.345// HAS_ERRNO_WIN-NOT: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80)346 347// HAS_MAYTRAP: declare double @llvm.experimental.constrained.fma.f64(348// HAS_MAYTRAP: declare float @llvm.experimental.constrained.fma.f32(349// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.fma.f80(350 351 fmax(f,f); fmaxf(f,f); fmaxl(f,f);352 353// NO__ERRNO: declare double @llvm.maxnum.f64(double, double) [[READNONE_INTRINSIC2]]354// NO__ERRNO: declare float @llvm.maxnum.f32(float, float) [[READNONE_INTRINSIC2]]355// NO__ERRNO: declare x86_fp80 @llvm.maxnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]356// HAS_ERRNO: declare double @llvm.maxnum.f64(double, double) [[READNONE_INTRINSIC2]]357// HAS_ERRNO: declare float @llvm.maxnum.f32(float, float) [[READNONE_INTRINSIC2]]358// HAS_ERRNO: declare x86_fp80 @llvm.maxnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]359// HAS_MAYTRAP: declare double @llvm.experimental.constrained.maxnum.f64(360// HAS_MAYTRAP: declare float @llvm.experimental.constrained.maxnum.f32(361// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.maxnum.f80(362 363 fmin(f,f); fminf(f,f); fminl(f,f);364 365// NO__ERRNO: declare double @llvm.minnum.f64(double, double) [[READNONE_INTRINSIC2]]366// NO__ERRNO: declare float @llvm.minnum.f32(float, float) [[READNONE_INTRINSIC2]]367// NO__ERRNO: declare x86_fp80 @llvm.minnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]368// HAS_ERRNO: declare double @llvm.minnum.f64(double, double) [[READNONE_INTRINSIC2]]369// HAS_ERRNO: declare float @llvm.minnum.f32(float, float) [[READNONE_INTRINSIC2]]370// HAS_ERRNO: declare x86_fp80 @llvm.minnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]371// HAS_MAYTRAP: declare double @llvm.experimental.constrained.minnum.f64(372// HAS_MAYTRAP: declare float @llvm.experimental.constrained.minnum.f32(373// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.minnum.f80(374 375 fmaximum_num(*d,*d); fmaximum_numf(f,f); fmaximum_numl(*l,*l);376 377// COMMON: declare double @llvm.maximumnum.f64(double, double) [[READNONE_INTRINSIC2]]378// COMMON: declare float @llvm.maximumnum.f32(float, float) [[READNONE_INTRINSIC2]]379// COMMON: declare x86_fp80 @llvm.maximumnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]380 381 fminimum_num(*d,*d); fminimum_numf(f,f); fminimum_numl(*l,*l);382 383// COMMON: declare double @llvm.minimumnum.f64(double, double) [[READNONE_INTRINSIC2]]384// COMMON: declare float @llvm.minimumnum.f32(float, float) [[READNONE_INTRINSIC2]]385// COMMON: declare x86_fp80 @llvm.minimumnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC2]]386 387 hypot(f,f); hypotf(f,f); hypotl(f,f);388 389// NO__ERRNO: declare double @hypot(double noundef, double noundef) [[READNONE]]390// NO__ERRNO: declare float @hypotf(float noundef, float noundef) [[READNONE]]391// NO__ERRNO: declare x86_fp80 @hypotl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]392// HAS_ERRNO: declare double @hypot(double noundef, double noundef) [[NOT_READNONE]]393// HAS_ERRNO: declare float @hypotf(float noundef, float noundef) [[NOT_READNONE]]394// HAS_ERRNO: declare x86_fp80 @hypotl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]395// HAS_MAYTRAP: declare double @hypot(double noundef, double noundef) [[NOT_READNONE]]396// HAS_MAYTRAP: declare float @hypotf(float noundef, float noundef) [[NOT_READNONE]]397// HAS_MAYTRAP: declare x86_fp80 @hypotl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]398 399 ilogb(f); ilogbf(f); ilogbl(f);400 401// NO__ERRNO: declare i32 @ilogb(double noundef) [[READNONE]]402// NO__ERRNO: declare i32 @ilogbf(float noundef) [[READNONE]]403// NO__ERRNO: declare i32 @ilogbl(x86_fp80 noundef) [[READNONE]]404// HAS_ERRNO: declare i32 @ilogb(double noundef) [[NOT_READNONE]]405// HAS_ERRNO: declare i32 @ilogbf(float noundef) [[NOT_READNONE]]406// HAS_ERRNO: declare i32 @ilogbl(x86_fp80 noundef) [[NOT_READNONE]]407// HAS_MAYTRAP: declare i32 @ilogb(double noundef) [[NOT_READNONE]]408// HAS_MAYTRAP: declare i32 @ilogbf(float noundef) [[NOT_READNONE]]409// HAS_MAYTRAP: declare i32 @ilogbl(x86_fp80 noundef) [[NOT_READNONE]]410 411 lgamma(f); lgammaf(f); lgammal(f);412 413// NO__ERRNO: declare double @lgamma(double noundef) [[NOT_READNONE]]414// NO__ERRNO: declare float @lgammaf(float noundef) [[NOT_READNONE]]415// NO__ERRNO: declare x86_fp80 @lgammal(x86_fp80 noundef) [[NOT_READNONE]]416// HAS_ERRNO: declare double @lgamma(double noundef) [[NOT_READNONE]]417// HAS_ERRNO: declare float @lgammaf(float noundef) [[NOT_READNONE]]418// HAS_ERRNO: declare x86_fp80 @lgammal(x86_fp80 noundef) [[NOT_READNONE]]419// HAS_MAYTRAP: declare double @lgamma(double noundef) [[NOT_READNONE]]420// HAS_MAYTRAP: declare float @lgammaf(float noundef) [[NOT_READNONE]]421// HAS_MAYTRAP: declare x86_fp80 @lgammal(x86_fp80 noundef) [[NOT_READNONE]]422 423 llrint(f); llrintf(f); llrintl(f);424 425// NO__ERRNO: declare i64 @llvm.llrint.i64.f64(double) [[READNONE_INTRINSIC2]]426// NO__ERRNO: declare i64 @llvm.llrint.i64.f32(float) [[READNONE_INTRINSIC2]]427// NO__ERRNO: declare i64 @llvm.llrint.i64.f80(x86_fp80) [[READNONE_INTRINSIC2]]428// HAS_ERRNO: declare i64 @llrint(double noundef) [[NOT_READNONE]]429// HAS_ERRNO: declare i64 @llrintf(float noundef) [[NOT_READNONE]]430// HAS_ERRNO: declare i64 @llrintl(x86_fp80 noundef) [[NOT_READNONE]]431// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.llrint.i64.f64(432// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.llrint.i64.f32(433// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.llrint.i64.f80(434 435 llround(f); llroundf(f); llroundl(f);436 437// NO__ERRNO: declare i64 @llvm.llround.i64.f64(double) [[READNONE_INTRINSIC2]]438// NO__ERRNO: declare i64 @llvm.llround.i64.f32(float) [[READNONE_INTRINSIC2]]439// NO__ERRNO: declare i64 @llvm.llround.i64.f80(x86_fp80) [[READNONE_INTRINSIC2]]440// HAS_ERRNO: declare i64 @llround(double noundef) [[NOT_READNONE]]441// HAS_ERRNO: declare i64 @llroundf(float noundef) [[NOT_READNONE]]442// HAS_ERRNO: declare i64 @llroundl(x86_fp80 noundef) [[NOT_READNONE]]443// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.llround.i64.f64(444// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.llround.i64.f32(445// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.llround.i64.f80(446 447 log(f); logf(f); logl(f);448 449// NO__ERRNO: declare double @llvm.log.f64(double) [[READNONE_INTRINSIC2]]450// NO__ERRNO: declare float @llvm.log.f32(float) [[READNONE_INTRINSIC2]]451// NO__ERRNO: declare x86_fp80 @llvm.log.f80(x86_fp80) [[READNONE_INTRINSIC2]]452// HAS_ERRNO: declare double @log(double noundef) [[NOT_READNONE]]453// HAS_ERRNO: declare float @logf(float noundef) [[NOT_READNONE]]454// HAS_ERRNO: declare x86_fp80 @logl(x86_fp80 noundef) [[NOT_READNONE]]455// HAS_MAYTRAP: declare double @llvm.experimental.constrained.log.f64(456// HAS_MAYTRAP: declare float @llvm.experimental.constrained.log.f32(457// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.log.f80(458 459 log10(f); log10f(f); log10l(f);460 461// NO__ERRNO: declare double @llvm.log10.f64(double) [[READNONE_INTRINSIC2]]462// NO__ERRNO: declare float @llvm.log10.f32(float) [[READNONE_INTRINSIC2]]463// NO__ERRNO: declare x86_fp80 @llvm.log10.f80(x86_fp80) [[READNONE_INTRINSIC2]]464// HAS_ERRNO: declare double @log10(double noundef) [[NOT_READNONE]]465// HAS_ERRNO: declare float @log10f(float noundef) [[NOT_READNONE]]466// HAS_ERRNO: declare x86_fp80 @log10l(x86_fp80 noundef) [[NOT_READNONE]]467// HAS_MAYTRAP: declare double @llvm.experimental.constrained.log10.f64(468// HAS_MAYTRAP: declare float @llvm.experimental.constrained.log10.f32(469// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.log10.f80(470 471 log1p(f); log1pf(f); log1pl(f);472 473// NO__ERRNO: declare double @log1p(double noundef) [[READNONE]]474// NO__ERRNO: declare float @log1pf(float noundef) [[READNONE]]475// NO__ERRNO: declare x86_fp80 @log1pl(x86_fp80 noundef) [[READNONE]]476// HAS_ERRNO: declare double @log1p(double noundef) [[NOT_READNONE]]477// HAS_ERRNO: declare float @log1pf(float noundef) [[NOT_READNONE]]478// HAS_ERRNO: declare x86_fp80 @log1pl(x86_fp80 noundef) [[NOT_READNONE]]479// HAS_MAYTRAP: declare double @log1p(double noundef) [[NOT_READNONE]]480// HAS_MAYTRAP: declare float @log1pf(float noundef) [[NOT_READNONE]]481// HAS_MAYTRAP: declare x86_fp80 @log1pl(x86_fp80 noundef) [[NOT_READNONE]]482 483 log2(f); log2f(f); log2l(f);484 485// NO__ERRNO: declare double @llvm.log2.f64(double) [[READNONE_INTRINSIC2]]486// NO__ERRNO: declare float @llvm.log2.f32(float) [[READNONE_INTRINSIC2]]487// NO__ERRNO: declare x86_fp80 @llvm.log2.f80(x86_fp80) [[READNONE_INTRINSIC2]]488// HAS_ERRNO: declare double @log2(double noundef) [[NOT_READNONE]]489// HAS_ERRNO: declare float @log2f(float noundef) [[NOT_READNONE]]490// HAS_ERRNO: declare x86_fp80 @log2l(x86_fp80 noundef) [[NOT_READNONE]]491// HAS_MAYTRAP: declare double @llvm.experimental.constrained.log2.f64(492// HAS_MAYTRAP: declare float @llvm.experimental.constrained.log2.f32(493// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.log2.f80(494 495 logb(f); logbf(f); logbl(f);496 497// NO__ERRNO: declare double @logb(double noundef) [[READNONE]]498// NO__ERRNO: declare float @logbf(float noundef) [[READNONE]]499// NO__ERRNO: declare x86_fp80 @logbl(x86_fp80 noundef) [[READNONE]]500// HAS_ERRNO: declare double @logb(double noundef) [[NOT_READNONE]]501// HAS_ERRNO: declare float @logbf(float noundef) [[NOT_READNONE]]502// HAS_ERRNO: declare x86_fp80 @logbl(x86_fp80 noundef) [[NOT_READNONE]]503// HAS_MAYTRAP: declare double @logb(double noundef) [[NOT_READNONE]]504// HAS_MAYTRAP: declare float @logbf(float noundef) [[NOT_READNONE]]505// HAS_MAYTRAP: declare x86_fp80 @logbl(x86_fp80 noundef) [[NOT_READNONE]]506 507 lrint(f); lrintf(f); lrintl(f);508 509// NO__ERRNO: declare i64 @llvm.lrint.i64.f64(double) [[READNONE_INTRINSIC2]]510// NO__ERRNO: declare i64 @llvm.lrint.i64.f32(float) [[READNONE_INTRINSIC2]]511// NO__ERRNO: declare i64 @llvm.lrint.i64.f80(x86_fp80) [[READNONE_INTRINSIC2]]512// HAS_ERRNO: declare i64 @lrint(double noundef) [[NOT_READNONE]]513// HAS_ERRNO: declare i64 @lrintf(float noundef) [[NOT_READNONE]]514// HAS_ERRNO: declare i64 @lrintl(x86_fp80 noundef) [[NOT_READNONE]]515// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.lrint.i64.f64(516// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.lrint.i64.f32(517// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.lrint.i64.f80(518 519 lround(f); lroundf(f); lroundl(f);520 521// NO__ERRNO: declare i64 @llvm.lround.i64.f64(double) [[READNONE_INTRINSIC2]]522// NO__ERRNO: declare i64 @llvm.lround.i64.f32(float) [[READNONE_INTRINSIC2]]523// NO__ERRNO: declare i64 @llvm.lround.i64.f80(x86_fp80) [[READNONE_INTRINSIC2]]524// HAS_ERRNO: declare i64 @lround(double noundef) [[NOT_READNONE]]525// HAS_ERRNO: declare i64 @lroundf(float noundef) [[NOT_READNONE]]526// HAS_ERRNO: declare i64 @lroundl(x86_fp80 noundef) [[NOT_READNONE]]527// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.lround.i64.f64(528// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.lround.i64.f32(529// HAS_MAYTRAP: declare i64 @llvm.experimental.constrained.lround.i64.f80(530 531 nearbyint(f); nearbyintf(f); nearbyintl(f);532 533// NO__ERRNO: declare double @llvm.nearbyint.f64(double) [[READNONE_INTRINSIC2]]534// NO__ERRNO: declare float @llvm.nearbyint.f32(float) [[READNONE_INTRINSIC2]]535// NO__ERRNO: declare x86_fp80 @llvm.nearbyint.f80(x86_fp80) [[READNONE_INTRINSIC2]]536// HAS_ERRNO: declare double @llvm.nearbyint.f64(double) [[READNONE_INTRINSIC2]]537// HAS_ERRNO: declare float @llvm.nearbyint.f32(float) [[READNONE_INTRINSIC2]]538// HAS_ERRNO: declare x86_fp80 @llvm.nearbyint.f80(x86_fp80) [[READNONE_INTRINSIC2]]539// HAS_MAYTRAP: declare double @llvm.experimental.constrained.nearbyint.f64(540// HAS_MAYTRAP: declare float @llvm.experimental.constrained.nearbyint.f32(541// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.nearbyint.f80(542 543 nextafter(f,f); nextafterf(f,f); nextafterl(f,f);544 545// NO__ERRNO: declare double @nextafter(double noundef, double noundef) [[READNONE]]546// NO__ERRNO: declare float @nextafterf(float noundef, float noundef) [[READNONE]]547// NO__ERRNO: declare x86_fp80 @nextafterl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]548// HAS_ERRNO: declare double @nextafter(double noundef, double noundef) [[NOT_READNONE]]549// HAS_ERRNO: declare float @nextafterf(float noundef, float noundef) [[NOT_READNONE]]550// HAS_ERRNO: declare x86_fp80 @nextafterl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]551// HAS_MAYTRAP: declare double @nextafter(double noundef, double noundef) [[NOT_READNONE]]552// HAS_MAYTRAP: declare float @nextafterf(float noundef, float noundef) [[NOT_READNONE]]553// HAS_MAYTRAP: declare x86_fp80 @nextafterl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]554 555 nexttoward(f,f); nexttowardf(f,f);nexttowardl(f,f);556 557// NO__ERRNO: declare double @nexttoward(double noundef, x86_fp80 noundef) [[READNONE]]558// NO__ERRNO: declare float @nexttowardf(float noundef, x86_fp80 noundef) [[READNONE]]559// NO__ERRNO: declare x86_fp80 @nexttowardl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]560// HAS_ERRNO: declare double @nexttoward(double noundef, x86_fp80 noundef) [[NOT_READNONE]]561// HAS_ERRNO: declare float @nexttowardf(float noundef, x86_fp80 noundef) [[NOT_READNONE]]562// HAS_ERRNO: declare x86_fp80 @nexttowardl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]563// HAS_MAYTRAP: declare double @nexttoward(double noundef, x86_fp80 noundef) [[NOT_READNONE]]564// HAS_MAYTRAP: declare float @nexttowardf(float noundef, x86_fp80 noundef) [[NOT_READNONE]]565// HAS_MAYTRAP: declare x86_fp80 @nexttowardl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]566 567 remainder(f,f); remainderf(f,f); remainderl(f,f);568 569// NO__ERRNO: declare double @remainder(double noundef, double noundef) [[READNONE]]570// NO__ERRNO: declare float @remainderf(float noundef, float noundef) [[READNONE]]571// NO__ERRNO: declare x86_fp80 @remainderl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]572// HAS_ERRNO: declare double @remainder(double noundef, double noundef) [[NOT_READNONE]]573// HAS_ERRNO: declare float @remainderf(float noundef, float noundef) [[NOT_READNONE]]574// HAS_ERRNO: declare x86_fp80 @remainderl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]575// HAS_MAYTRAP: declare double @remainder(double noundef, double noundef) [[NOT_READNONE]]576// HAS_MAYTRAP: declare float @remainderf(float noundef, float noundef) [[NOT_READNONE]]577// HAS_MAYTRAP: declare x86_fp80 @remainderl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]578 579 remquo(f,f,i); remquof(f,f,i); remquol(f,f,i);580 581// NO__ERRNO: declare double @remquo(double noundef, double noundef, ptr noundef) [[NOT_READNONE]]582// NO__ERRNO: declare float @remquof(float noundef, float noundef, ptr noundef) [[NOT_READNONE]]583// NO__ERRNO: declare x86_fp80 @remquol(x86_fp80 noundef, x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]584// HAS_ERRNO: declare double @remquo(double noundef, double noundef, ptr noundef) [[NOT_READNONE]]585// HAS_ERRNO: declare float @remquof(float noundef, float noundef, ptr noundef) [[NOT_READNONE]]586// HAS_ERRNO: declare x86_fp80 @remquol(x86_fp80 noundef, x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]587// HAS_MAYTRAP: declare double @remquo(double noundef, double noundef, ptr noundef) [[NOT_READNONE]]588// HAS_MAYTRAP: declare float @remquof(float noundef, float noundef, ptr noundef) [[NOT_READNONE]]589// HAS_MAYTRAP: declare x86_fp80 @remquol(x86_fp80 noundef, x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]590 591 rint(f); rintf(f); rintl(f);592 593// NO__ERRNO: declare double @llvm.rint.f64(double) [[READNONE_INTRINSIC2]]594// NO__ERRNO: declare float @llvm.rint.f32(float) [[READNONE_INTRINSIC2]]595// NO__ERRNO: declare x86_fp80 @llvm.rint.f80(x86_fp80) [[READNONE_INTRINSIC2]]596// HAS_ERRNO: declare double @llvm.rint.f64(double) [[READNONE_INTRINSIC2]]597// HAS_ERRNO: declare float @llvm.rint.f32(float) [[READNONE_INTRINSIC2]]598// HAS_ERRNO: declare x86_fp80 @llvm.rint.f80(x86_fp80) [[READNONE_INTRINSIC2]]599// HAS_MAYTRAP: declare double @llvm.experimental.constrained.rint.f64(600// HAS_MAYTRAP: declare float @llvm.experimental.constrained.rint.f32(601// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.rint.f80(602 603 round(f); roundf(f); roundl(f);604 605// NO__ERRNO: declare double @llvm.round.f64(double) [[READNONE_INTRINSIC2]]606// NO__ERRNO: declare float @llvm.round.f32(float) [[READNONE_INTRINSIC2]]607// NO__ERRNO: declare x86_fp80 @llvm.round.f80(x86_fp80) [[READNONE_INTRINSIC2]]608// HAS_ERRNO: declare double @llvm.round.f64(double) [[READNONE_INTRINSIC2]]609// HAS_ERRNO: declare float @llvm.round.f32(float) [[READNONE_INTRINSIC2]]610// HAS_ERRNO: declare x86_fp80 @llvm.round.f80(x86_fp80) [[READNONE_INTRINSIC2]]611// HAS_MAYTRAP: declare double @llvm.experimental.constrained.round.f64(612// HAS_MAYTRAP: declare float @llvm.experimental.constrained.round.f32(613// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.round.f80(614 615 scalbln(f,f); scalblnf(f,f); scalblnl(f,f);616 617// NO__ERRNO: declare double @scalbln(double noundef, i64 noundef) [[READNONE]]618// NO__ERRNO: declare float @scalblnf(float noundef, i64 noundef) [[READNONE]]619// NO__ERRNO: declare x86_fp80 @scalblnl(x86_fp80 noundef, i64 noundef) [[READNONE]]620// HAS_ERRNO: declare double @scalbln(double noundef, i64 noundef) [[NOT_READNONE]]621// HAS_ERRNO: declare float @scalblnf(float noundef, i64 noundef) [[NOT_READNONE]]622// HAS_ERRNO: declare x86_fp80 @scalblnl(x86_fp80 noundef, i64 noundef) [[NOT_READNONE]]623// HAS_MAYTRAP: declare double @scalbln(double noundef, i64 noundef) [[NOT_READNONE]]624// HAS_MAYTRAP: declare float @scalblnf(float noundef, i64 noundef) [[NOT_READNONE]]625// HAS_MAYTRAP: declare x86_fp80 @scalblnl(x86_fp80 noundef, i64 noundef) [[NOT_READNONE]]626 627 scalbn(f,f); scalbnf(f,f); scalbnl(f,f);628 629// NO__ERRNO: declare double @scalbn(double noundef, i32 noundef) [[READNONE]]630// NO__ERRNO: declare float @scalbnf(float noundef, i32 noundef) [[READNONE]]631// NO__ERRNO: declare x86_fp80 @scalbnl(x86_fp80 noundef, i32 noundef) [[READNONE]]632// HAS_ERRNO: declare double @scalbn(double noundef, i32 noundef) [[NOT_READNONE]]633// HAS_ERRNO: declare float @scalbnf(float noundef, i32 noundef) [[NOT_READNONE]]634// HAS_ERRNO: declare x86_fp80 @scalbnl(x86_fp80 noundef, i32 noundef) [[NOT_READNONE]]635// HAS_MAYTRAP: declare double @scalbn(double noundef, i32 noundef) [[NOT_READNONE]]636// HAS_MAYTRAP: declare float @scalbnf(float noundef, i32 noundef) [[NOT_READNONE]]637// HAS_MAYTRAP: declare x86_fp80 @scalbnl(x86_fp80 noundef, i32 noundef) [[NOT_READNONE]]638 639 sin(f); sinf(f); sinl(f);640 641// NO__ERRNO: declare double @llvm.sin.f64(double) [[READNONE_INTRINSIC2]]642// NO__ERRNO: declare float @llvm.sin.f32(float) [[READNONE_INTRINSIC2]]643// NO__ERRNO: declare x86_fp80 @llvm.sin.f80(x86_fp80) [[READNONE_INTRINSIC2]]644// HAS_ERRNO: declare double @sin(double noundef) [[NOT_READNONE]]645// HAS_ERRNO: declare float @sinf(float noundef) [[NOT_READNONE]]646// HAS_ERRNO: declare x86_fp80 @sinl(x86_fp80 noundef) [[NOT_READNONE]]647// HAS_MAYTRAP: declare double @llvm.experimental.constrained.sin.f64(648// HAS_MAYTRAP: declare float @llvm.experimental.constrained.sin.f32(649// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.sin.f80(650 651 sinh(f); sinhf(f); sinhl(f);652 653// NO__ERRNO: declare double @llvm.sinh.f64(double) [[READNONE_INTRINSIC]]654// NO__ERRNO: declare float @llvm.sinh.f32(float) [[READNONE_INTRINSIC]]655// NO__ERRNO: declare x86_fp80 @llvm.sinh.f80(x86_fp80) [[READNONE_INTRINSIC]]656// HAS_ERRNO: declare double @sinh(double noundef) [[NOT_READNONE]]657// HAS_ERRNO: declare float @sinhf(float noundef) [[NOT_READNONE]]658// HAS_ERRNO: declare x86_fp80 @sinhl(x86_fp80 noundef) [[NOT_READNONE]]659// HAS_MAYTRAP: declare double @llvm.experimental.constrained.sinh.f64(660// HAS_MAYTRAP: declare float @llvm.experimental.constrained.sinh.f32(661// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.sinh.f80(662 663sincos(f, d, d); sincosf(f, fp, fp); sincosl(f, l, l);664 665// NO__ERRNO: declare { double, double } @llvm.sincos.f64(double) [[READNONE_INTRINSIC]]666// NO__ERRNO: declare { float, float } @llvm.sincos.f32(float) [[READNONE_INTRINSIC]]667// NO__ERRNO: declare { x86_fp80, x86_fp80 } @llvm.sincos.f80(x86_fp80) [[READNONE_INTRINSIC]]668// HAS_ERRNO: declare void @sincos(double noundef, ptr noundef, ptr noundef) [[NOT_READNONE]]669// HAS_ERRNO: declare void @sincosf(float noundef, ptr noundef, ptr noundef) [[NOT_READNONE]]670// HAS_ERRNO: declare void @sincosl(x86_fp80 noundef, ptr noundef, ptr noundef) [[NOT_READNONE]]671// HAS_MAYTRAP: declare void @sincos(double noundef, ptr noundef, ptr noundef) [[NOT_READNONE]]672// HAS_MAYTRAP: declare void @sincosf(float noundef, ptr noundef, ptr noundef) [[NOT_READNONE]]673// HAS_MAYTRAP: declare void @sincosl(x86_fp80 noundef, ptr noundef, ptr noundef) [[NOT_READNONE]]674 675 sqrt(f); sqrtf(f); sqrtl(f);676 677// NO__ERRNO: declare double @llvm.sqrt.f64(double) [[READNONE_INTRINSIC2]]678// NO__ERRNO: declare float @llvm.sqrt.f32(float) [[READNONE_INTRINSIC2]]679// NO__ERRNO: declare x86_fp80 @llvm.sqrt.f80(x86_fp80) [[READNONE_INTRINSIC2]]680// HAS_ERRNO: declare double @sqrt(double noundef) [[NOT_READNONE]]681// HAS_ERRNO: declare float @sqrtf(float noundef) [[NOT_READNONE]]682// HAS_ERRNO: declare x86_fp80 @sqrtl(x86_fp80 noundef) [[NOT_READNONE]]683// HAS_MAYTRAP: declare double @llvm.experimental.constrained.sqrt.f64(684// HAS_MAYTRAP: declare float @llvm.experimental.constrained.sqrt.f32(685// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.sqrt.f80(686 687 tan(f); tanf(f); tanl(f);688 689// NO__ERRNO: declare double @llvm.tan.f64(double) [[READNONE_INTRINSIC]]690// NO__ERRNO: declare float @llvm.tan.f32(float) [[READNONE_INTRINSIC]]691// NO__ERRNO: declare x86_fp80 @llvm.tan.f80(x86_fp80) [[READNONE_INTRINSIC]]692// HAS_ERRNO: declare double @tan(double noundef) [[NOT_READNONE]]693// HAS_ERRNO: declare float @tanf(float noundef) [[NOT_READNONE]]694// HAS_ERRNO: declare x86_fp80 @tanl(x86_fp80 noundef) [[NOT_READNONE]]695// HAS_MAYTRAP: declare double @llvm.experimental.constrained.tan.f64(696// HAS_MAYTRAP: declare float @llvm.experimental.constrained.tan.f32(697// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.tan.f80(698 699 tanh(f); tanhf(f); tanhl(f);700 701// NO__ERRNO: declare double @llvm.tanh.f64(double) [[READNONE_INTRINSIC]]702// NO__ERRNO: declare float @llvm.tanh.f32(float) [[READNONE_INTRINSIC]]703// NO__ERRNO: declare x86_fp80 @llvm.tanh.f80(x86_fp80) [[READNONE_INTRINSIC]]704// HAS_ERRNO: declare double @tanh(double noundef) [[NOT_READNONE]]705// HAS_ERRNO: declare float @tanhf(float noundef) [[NOT_READNONE]]706// HAS_ERRNO: declare x86_fp80 @tanhl(x86_fp80 noundef) [[NOT_READNONE]]707// HAS_MAYTRAP: declare double @llvm.experimental.constrained.tanh.f64(708// HAS_MAYTRAP: declare float @llvm.experimental.constrained.tanh.f32(709// HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.tanh.f80(710 711 tgamma(f); tgammaf(f); tgammal(f);712 713// NO__ERRNO: declare double @tgamma(double noundef) [[READNONE]]714// NO__ERRNO: declare float @tgammaf(float noundef) [[READNONE]]715// NO__ERRNO: declare x86_fp80 @tgammal(x86_fp80 noundef) [[READNONE]]716// HAS_ERRNO: declare double @tgamma(double noundef) [[NOT_READNONE]]717// HAS_ERRNO: declare float @tgammaf(float noundef) [[NOT_READNONE]]718// HAS_ERRNO: declare x86_fp80 @tgammal(x86_fp80 noundef) [[NOT_READNONE]]719// HAS_MAYTRAP: declare double @tgamma(double noundef) [[NOT_READNONE]]720// HAS_MAYTRAP: declare float @tgammaf(float noundef) [[NOT_READNONE]]721// HAS_MAYTRAP: declare x86_fp80 @tgammal(x86_fp80 noundef) [[NOT_READNONE]]722 723 trunc(f); truncf(f); truncl(f);724 725// NO__ERRNO: declare double @llvm.trunc.f64(double) [[READNONE_INTRINSIC2]]726// NO__ERRNO: declare float @llvm.trunc.f32(float) [[READNONE_INTRINSIC2]]727// NO__ERRNO: declare x86_fp80 @llvm.trunc.f80(x86_fp80) [[READNONE_INTRINSIC2]]728// HAS_ERRNO: declare double @llvm.trunc.f64(double) [[READNONE_INTRINSIC2]]729// HAS_ERRNO: declare float @llvm.trunc.f32(float) [[READNONE_INTRINSIC2]]730// HAS_ERRNO: declare x86_fp80 @llvm.trunc.f80(x86_fp80) [[READNONE_INTRINSIC2]]731};732 733// NO__ERRNO: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }734// NO__ERRNO: attributes [[READNONE_INTRINSIC2]] = { {{.*}}memory(none){{.*}} }735// NO__ERRNO: attributes [[NOT_READNONE]] = { nounwind {{.*}} }736// NO__ERRNO: attributes [[READNONE]] = { {{.*}}memory(none){{.*}} }737// NO__ERRNO: attributes [[READONLY]] = { {{.*}}memory(read){{.*}} }738 739// HAS_ERRNO: attributes [[NOT_READNONE]] = { nounwind {{.*}} }740// HAS_ERRNO: attributes [[READNONE_INTRINSIC2]] = { {{.*}}memory(none){{.*}} }741// HAS_ERRNO: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }742// HAS_ERRNO: attributes [[READONLY]] = { {{.*}}memory(read){{.*}} }743// HAS_ERRNO: attributes [[READNONE]] = { {{.*}}memory(none){{.*}} }744 745// HAS_MAYTRAP: attributes [[NOT_READNONE]] = { nounwind {{.*}} }746// HAS_MAYTRAP: attributes [[READNONE]] = { {{.*}}memory(none){{.*}} }747 748// HAS_ERRNO_GNU: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }749// HAS_ERRNO_WIN: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }750