Benjamin Kramer | 5c1dcc5 | 2012-08-22 18:16:02 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin12 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=CHECK-NOERRNO |
Benjamin Kramer | a148fbc | 2012-08-22 18:50:01 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple x86_64-linux-gnu -S -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=CHECK-ERRNO |
Benjamin Kramer | 5c1dcc5 | 2012-08-22 18:16:02 +0000 | [diff] [blame] | 3 | |
| 4 | // Prototypes. |
| 5 | double acos(double); |
| 6 | long double acosl(long double); |
| 7 | float acosf(float); |
| 8 | double asin(double); |
| 9 | long double asinl(long double); |
| 10 | float asinf(float); |
| 11 | double atan(double); |
| 12 | long double atanl(long double); |
| 13 | float atanf(float); |
| 14 | double atan2(double, double); |
| 15 | long double atan2l(long double, long double); |
| 16 | float atan2f(float, float); |
| 17 | double ceil(double); |
| 18 | long double ceill(long double); |
| 19 | float ceilf(float); |
| 20 | double copysign(double, double); |
| 21 | long double copysignl(long double, long double); |
| 22 | float copysignf(float, float); |
| 23 | double cos(double); |
| 24 | long double cosl(long double); |
| 25 | float cosf(float); |
| 26 | double exp(double); |
| 27 | long double expl(long double); |
| 28 | float expf(float); |
| 29 | double exp2(double); |
| 30 | long double exp2l(long double); |
| 31 | float exp2f(float); |
| 32 | double fabs(double); |
| 33 | long double fabsl(long double); |
| 34 | float fabsf(float); |
| 35 | double floor(double); |
| 36 | long double floorl(long double); |
| 37 | float floorf(float); |
| 38 | double fma(double, double, double); |
| 39 | long double fmal(long double, long double, long double); |
| 40 | float fmaf(float, float, float); |
| 41 | double fmax(double, double); |
| 42 | long double fmaxl(long double, long double); |
| 43 | float fmaxf(float, float); |
| 44 | double fmin(double, double); |
| 45 | long double fminl(long double, long double); |
| 46 | float fminf(float, float); |
| 47 | double log(double); |
| 48 | long double logl(long double); |
| 49 | float logf(float); |
| 50 | double log2(double); |
| 51 | long double log2l(long double); |
| 52 | float log2f(float); |
| 53 | double nearbyint(double); |
| 54 | long double nearbyintl(long double); |
| 55 | float nearbyintf(float); |
| 56 | double pow(double, double); |
| 57 | long double powl(long double, long double); |
| 58 | float powf(float, float); |
| 59 | double rint(double); |
| 60 | long double rintl(long double); |
| 61 | float rintf(float); |
| 62 | double round(double); |
| 63 | long double roundl(long double); |
| 64 | float roundf(float); |
| 65 | double sin(double); |
| 66 | long double sinl(long double); |
| 67 | float sinf(float); |
| 68 | double sqrt(double); |
| 69 | long double sqrtl(long double); |
| 70 | float sqrtf(float); |
| 71 | double tan(double); |
| 72 | long double tanl(long double); |
| 73 | float tanf(float); |
| 74 | double trunc(double); |
| 75 | long double truncl(long double); |
| 76 | float truncf(float); |
| 77 | |
| 78 | // Force emission of the declare statements. |
| 79 | void *use[] = { |
| 80 | acos, acosl, acosf, asin, asinl, asinf, atan, atanl, atanf, atan2, atan2l, |
| 81 | atan2f, ceil, ceill, ceilf, copysign, copysignl, copysignf, cos, cosl, cosf, |
| 82 | exp, expl, expf, exp2, exp2l, exp2f, fabs, fabsl, fabsf, floor, floorl, |
| 83 | floorf, fma, fmal, fmaf, fmax, fmaxl, fmaxf, fmin, fminl, fminf, log, logl, |
| 84 | logf, log2, log2l, log2f, nearbyint, nearbyintl, nearbyintf, pow, powl, powf, |
| 85 | rint, rintl, rintf, round, roundl, roundf, sin, sinl, sinf, sqrt, sqrtl, |
| 86 | sqrtf, tan, tanl, tanf, trunc, truncl, truncf |
| 87 | }; |
| 88 | |
| 89 | // CHECK-NOERRNO: declare double @acos(double) nounwind readnone |
| 90 | // CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) nounwind readnone |
| 91 | // CHECK-NOERRNO: declare float @acosf(float) nounwind readnone |
| 92 | // CHECK-NOERRNO: declare double @asin(double) nounwind readnone |
| 93 | // CHECK-NOERRNO: declare x86_fp80 @asinl(x86_fp80) nounwind readnone |
| 94 | // CHECK-NOERRNO: declare float @asinf(float) nounwind readnone |
| 95 | // CHECK-NOERRNO: declare double @atan(double) nounwind readnone |
| 96 | // CHECK-NOERRNO: declare x86_fp80 @atanl(x86_fp80) nounwind readnone |
| 97 | // CHECK-NOERRNO: declare float @atanf(float) nounwind readnone |
| 98 | // CHECK-NOERRNO: declare double @atan2(double, double) nounwind readnone |
| 99 | // CHECK-NOERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) nounwind readnone |
| 100 | // CHECK-NOERRNO: declare float @atan2f(float, float) nounwind readnone |
| 101 | // CHECK-NOERRNO: declare double @ceil(double) nounwind readnone |
| 102 | // CHECK-NOERRNO: declare x86_fp80 @ceill(x86_fp80) nounwind readnone |
| 103 | // CHECK-NOERRNO: declare float @ceilf(float) nounwind readnone |
| 104 | // CHECK-NOERRNO: declare double @copysign(double, double) nounwind readnone |
| 105 | // CHECK-NOERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone |
| 106 | // CHECK-NOERRNO: declare float @copysignf(float, float) nounwind readnone |
| 107 | // CHECK-NOERRNO: declare double @cos(double) nounwind readnone |
| 108 | // CHECK-NOERRNO: declare x86_fp80 @cosl(x86_fp80) nounwind readnone |
| 109 | // CHECK-NOERRNO: declare float @cosf(float) nounwind readnone |
| 110 | // CHECK-NOERRNO: declare double @exp(double) nounwind readnone |
| 111 | // CHECK-NOERRNO: declare x86_fp80 @expl(x86_fp80) nounwind readnone |
| 112 | // CHECK-NOERRNO: declare float @expf(float) nounwind readnone |
| 113 | // CHECK-NOERRNO: declare double @exp2(double) nounwind readnone |
| 114 | // CHECK-NOERRNO: declare x86_fp80 @exp2l(x86_fp80) nounwind readnone |
| 115 | // CHECK-NOERRNO: declare float @exp2f(float) nounwind readnone |
| 116 | // CHECK-NOERRNO: declare double @fabs(double) nounwind readnone |
| 117 | // CHECK-NOERRNO: declare x86_fp80 @fabsl(x86_fp80) nounwind readnone |
| 118 | // CHECK-NOERRNO: declare float @fabsf(float) nounwind readnone |
| 119 | // CHECK-NOERRNO: declare double @floor(double) nounwind readnone |
| 120 | // CHECK-NOERRNO: declare x86_fp80 @floorl(x86_fp80) nounwind readnone |
| 121 | // CHECK-NOERRNO: declare float @floorf(float) nounwind readnone |
| 122 | // CHECK-NOERRNO: declare double @fma(double, double, double) nounwind readnone |
| 123 | // CHECK-NOERRNO: declare x86_fp80 @fmal(x86_fp80, x86_fp80, x86_fp80) nounwind readnone |
| 124 | // CHECK-NOERRNO: declare float @fmaf(float, float, float) nounwind readnone |
| 125 | // CHECK-NOERRNO: declare double @fmax(double, double) nounwind readnone |
| 126 | // CHECK-NOERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) nounwind readnone |
| 127 | // CHECK-NOERRNO: declare float @fmaxf(float, float) nounwind readnone |
| 128 | // CHECK-NOERRNO: declare double @fmin(double, double) nounwind readnone |
| 129 | // CHECK-NOERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) nounwind readnone |
| 130 | // CHECK-NOERRNO: declare float @fminf(float, float) nounwind readnone |
| 131 | // CHECK-NOERRNO: declare double @log(double) nounwind readnone |
| 132 | // CHECK-NOERRNO: declare x86_fp80 @logl(x86_fp80) nounwind readnone |
| 133 | // CHECK-NOERRNO: declare float @logf(float) nounwind readnone |
| 134 | // CHECK-NOERRNO: declare double @log2(double) nounwind readnone |
| 135 | // CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) nounwind readnone |
| 136 | // CHECK-NOERRNO: declare float @log2f(float) nounwind readnone |
| 137 | // CHECK-NOERRNO: declare double @nearbyint(double) nounwind readnone |
| 138 | // CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) nounwind readnone |
| 139 | // CHECK-NOERRNO: declare float @nearbyintf(float) nounwind readnone |
| 140 | // CHECK-NOERRNO: declare double @pow(double, double) nounwind readnone |
| 141 | // CHECK-NOERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) nounwind readnone |
| 142 | // CHECK-NOERRNO: declare float @powf(float, float) nounwind readnone |
| 143 | // CHECK-NOERRNO: declare double @rint(double) nounwind readnone |
| 144 | // CHECK-NOERRNO: declare x86_fp80 @rintl(x86_fp80) nounwind readnone |
| 145 | // CHECK-NOERRNO: declare float @rintf(float) nounwind readnone |
| 146 | // CHECK-NOERRNO: declare double @round(double) nounwind readnone |
| 147 | // CHECK-NOERRNO: declare x86_fp80 @roundl(x86_fp80) nounwind readnone |
| 148 | // CHECK-NOERRNO: declare float @roundf(float) nounwind readnone |
| 149 | // CHECK-NOERRNO: declare double @sin(double) nounwind readnone |
| 150 | // CHECK-NOERRNO: declare x86_fp80 @sinl(x86_fp80) nounwind readnone |
| 151 | // CHECK-NOERRNO: declare float @sinf(float) nounwind readnone |
| 152 | // CHECK-NOERRNO: declare double @sqrt(double) nounwind readnone |
| 153 | // CHECK-NOERRNO: declare x86_fp80 @sqrtl(x86_fp80) nounwind readnone |
| 154 | // CHECK-NOERRNO: declare float @sqrtf(float) nounwind readnone |
| 155 | // CHECK-NOERRNO: declare double @tan(double) nounwind readnone |
| 156 | // CHECK-NOERRNO: declare x86_fp80 @tanl(x86_fp80) nounwind readnone |
| 157 | // CHECK-NOERRNO: declare float @tanf(float) nounwind readnone |
| 158 | // CHECK-NOERRNO: declare double @trunc(double) nounwind readnone |
| 159 | // CHECK-NOERRNO: declare x86_fp80 @truncl(x86_fp80) nounwind readnone |
| 160 | // CHECK-NOERRNO: declare float @truncf(float) nounwind readnone |
| 161 | |
Benjamin Kramer | a148fbc | 2012-08-22 18:50:01 +0000 | [diff] [blame] | 162 | // CHECK-ERRNO: declare double @ceil(double) nounwind readnone |
| 163 | // CHECK-ERRNO: declare x86_fp80 @ceill(x86_fp80) nounwind readnone |
| 164 | // CHECK-ERRNO: declare float @ceilf(float) nounwind readnone |
Benjamin Kramer | 5c1dcc5 | 2012-08-22 18:16:02 +0000 | [diff] [blame] | 165 | // CHECK-ERRNO: declare double @copysign(double, double) nounwind readnone |
| 166 | // CHECK-ERRNO: declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone |
| 167 | // CHECK-ERRNO: declare float @copysignf(float, float) nounwind readnone |
| 168 | // CHECK-ERRNO: declare double @fabs(double) nounwind readnone |
| 169 | // CHECK-ERRNO: declare x86_fp80 @fabsl(x86_fp80) nounwind readnone |
| 170 | // CHECK-ERRNO: declare float @fabsf(float) nounwind readnone |
Benjamin Kramer | a148fbc | 2012-08-22 18:50:01 +0000 | [diff] [blame] | 171 | // CHECK-ERRNO: declare double @floor(double) nounwind readnone |
| 172 | // CHECK-ERRNO: declare x86_fp80 @floorl(x86_fp80) nounwind readnone |
| 173 | // CHECK-ERRNO: declare float @floorf(float) nounwind readnone |
Benjamin Kramer | 5c1dcc5 | 2012-08-22 18:16:02 +0000 | [diff] [blame] | 174 | // CHECK-ERRNO: declare double @fmax(double, double) nounwind readnone |
| 175 | // CHECK-ERRNO: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80) nounwind readnone |
| 176 | // CHECK-ERRNO: declare float @fmaxf(float, float) nounwind readnone |
| 177 | // CHECK-ERRNO: declare double @fmin(double, double) nounwind readnone |
| 178 | // CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) nounwind readnone |
| 179 | // CHECK-ERRNO: declare float @fminf(float, float) nounwind readnone |
Benjamin Kramer | a148fbc | 2012-08-22 18:50:01 +0000 | [diff] [blame] | 180 | // CHECK-ERRNO: declare double @nearbyint(double) nounwind readnone |
| 181 | // CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) nounwind readnone |
| 182 | // CHECK-ERRNO: declare float @nearbyintf(float) nounwind readnone |
| 183 | // CHECK-ERRNO: declare double @rint(double) nounwind readnone |
| 184 | // CHECK-ERRNO: declare x86_fp80 @rintl(x86_fp80) nounwind readnone |
| 185 | // CHECK-ERRNO: declare float @rintf(float) nounwind readnone |
| 186 | // CHECK-ERRNO: declare double @round(double) nounwind readnone |
| 187 | // CHECK-ERRNO: declare x86_fp80 @roundl(x86_fp80) nounwind readnone |
| 188 | // CHECK-ERRNO: declare float @roundf(float) nounwind readnone |
Benjamin Kramer | 5c1dcc5 | 2012-08-22 18:16:02 +0000 | [diff] [blame] | 189 | // CHECK-ERRNO: declare double @trunc(double) nounwind readnone |
| 190 | // CHECK-ERRNO: declare x86_fp80 @truncl(x86_fp80) nounwind readnone |
| 191 | // CHECK-ERRNO: declare float @truncf(float) nounwind readnone |