blob: 4517643e4c4ed3ce19e55376d1baa69e198b384a [file] [log] [blame]
Benjamin Kramer5c1dcc52012-08-22 18:16:02 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin12 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=CHECK-NOERRNO
Benjamin Kramera148fbc2012-08-22 18:50:01 +00002// RUN: %clang_cc1 -triple x86_64-linux-gnu -S -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=CHECK-ERRNO
Benjamin Kramer5c1dcc52012-08-22 18:16:02 +00003
4// Prototypes.
5double acos(double);
6long double acosl(long double);
7float acosf(float);
8double asin(double);
9long double asinl(long double);
10float asinf(float);
11double atan(double);
12long double atanl(long double);
13float atanf(float);
14double atan2(double, double);
15long double atan2l(long double, long double);
16float atan2f(float, float);
17double ceil(double);
18long double ceill(long double);
19float ceilf(float);
20double copysign(double, double);
21long double copysignl(long double, long double);
22float copysignf(float, float);
23double cos(double);
24long double cosl(long double);
25float cosf(float);
26double exp(double);
27long double expl(long double);
28float expf(float);
29double exp2(double);
30long double exp2l(long double);
31float exp2f(float);
32double fabs(double);
33long double fabsl(long double);
34float fabsf(float);
35double floor(double);
36long double floorl(long double);
37float floorf(float);
38double fma(double, double, double);
39long double fmal(long double, long double, long double);
40float fmaf(float, float, float);
41double fmax(double, double);
42long double fmaxl(long double, long double);
43float fmaxf(float, float);
44double fmin(double, double);
45long double fminl(long double, long double);
46float fminf(float, float);
47double log(double);
48long double logl(long double);
49float logf(float);
50double log2(double);
51long double log2l(long double);
52float log2f(float);
53double nearbyint(double);
54long double nearbyintl(long double);
55float nearbyintf(float);
56double pow(double, double);
57long double powl(long double, long double);
58float powf(float, float);
59double rint(double);
60long double rintl(long double);
61float rintf(float);
62double round(double);
63long double roundl(long double);
64float roundf(float);
65double sin(double);
66long double sinl(long double);
67float sinf(float);
68double sqrt(double);
69long double sqrtl(long double);
70float sqrtf(float);
71double tan(double);
72long double tanl(long double);
73float tanf(float);
74double trunc(double);
75long double truncl(long double);
76float truncf(float);
77
78// Force emission of the declare statements.
79void *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 Kramera148fbc2012-08-22 18:50:01 +0000162// 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 Kramer5c1dcc52012-08-22 18:16:02 +0000165// 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 Kramera148fbc2012-08-22 18:50:01 +0000171// 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 Kramer5c1dcc52012-08-22 18:16:02 +0000174// 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 Kramera148fbc2012-08-22 18:50:01 +0000180// 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 Kramer5c1dcc52012-08-22 18:16:02 +0000189// 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