llvm.org GIT mirror llvm / 5cd01d9
Fix unit tests after patch https://reviews.llvm.org/rL346313 Summary: Tests are broken so fix them. Reviewers: marco-c Reviewed By: marco-c Subscribers: sylvestre.ledru, llvm-commits Differential Revision: https://reviews.llvm.org/D54208 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346318 91177308-0d34-0410-b5e6-96231b3b80d8 Calixte Denizet 10 months ago
2 changed file(s) with 475 addition(s) and 470 deletion(s). Raw diff Collapse all Expand all
614614 switch (F) {
615615 case LibFunc_execl:
616616 case LibFunc_execlp:
617 case LibFunc_execle:
617618 return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() &&
618619 FTy.getParamType(1)->isPointerTy() &&
619 FTy.getReturnType()->isIntegerTy(32));
620 case LibFunc_execle:
621 return (NumParams >= 3 && FTy.getParamType(0)->isPointerTy() &&
622 FTy.getParamType(1)->isPointerTy() &&
623 FTy.getParamType(NumParams - 1)->isPointerTy() &&
624620 FTy.getReturnType()->isIntegerTy(32));
625621 case LibFunc_execv:
626622 case LibFunc_execvp:
7575 // Check that we do accept know-correct prototypes.
7676 TEST_F(TargetLibraryInfoTest, ValidProto) {
7777 parseAssembly(
78 // These functions use a 64-bit size_t; use the appropriate datalayout.
79 "target datalayout = \"p:64:64:64\"\n"
80
81 // Struct pointers are replaced with an opaque pointer.
82 "%struct = type opaque\n"
83
84 // These functions were extracted as-is from the OS X headers.
85 "declare double @__cospi(double)\n"
86 "declare float @__cospif(float)\n"
87 "declare { double, double } @__sincospi_stret(double)\n"
88 "declare <2 x float> @__sincospif_stret(float)\n"
89 "declare double @__sinpi(double)\n"
90 "declare float @__sinpif(float)\n"
91 "declare i32 @abs(i32)\n"
92 "declare i32 @access(i8*, i32)\n"
93 "declare double @acos(double)\n"
94 "declare float @acosf(float)\n"
95 "declare double @acosh(double)\n"
96 "declare float @acoshf(float)\n"
97 "declare x86_fp80 @acoshl(x86_fp80)\n"
98 "declare x86_fp80 @acosl(x86_fp80)\n"
99 "declare double @asin(double)\n"
100 "declare float @asinf(float)\n"
101 "declare double @asinh(double)\n"
102 "declare float @asinhf(float)\n"
103 "declare x86_fp80 @asinhl(x86_fp80)\n"
104 "declare x86_fp80 @asinl(x86_fp80)\n"
105 "declare double @atan(double)\n"
106 "declare double @atan2(double, double)\n"
107 "declare float @atan2f(float, float)\n"
108 "declare x86_fp80 @atan2l(x86_fp80, x86_fp80)\n"
109 "declare float @atanf(float)\n"
110 "declare double @atanh(double)\n"
111 "declare float @atanhf(float)\n"
112 "declare x86_fp80 @atanhl(x86_fp80)\n"
113 "declare x86_fp80 @atanl(x86_fp80)\n"
114 "declare double @atof(i8*)\n"
115 "declare i32 @atoi(i8*)\n"
116 "declare i64 @atol(i8*)\n"
117 "declare i64 @atoll(i8*)\n"
118 "declare i32 @bcmp(i8*, i8*, i64)\n"
119 "declare void @bcopy(i8*, i8*, i64)\n"
120 "declare void @bzero(i8*, i64)\n"
121 "declare i8* @calloc(i64, i64)\n"
122 "declare double @cbrt(double)\n"
123 "declare float @cbrtf(float)\n"
124 "declare x86_fp80 @cbrtl(x86_fp80)\n"
125 "declare double @ceil(double)\n"
126 "declare float @ceilf(float)\n"
127 "declare x86_fp80 @ceill(x86_fp80)\n"
128 "declare i32 @chown(i8*, i32, i32)\n"
129 "declare void @clearerr(%struct*)\n"
130 "declare double @copysign(double, double)\n"
131 "declare float @copysignf(float, float)\n"
132 "declare x86_fp80 @copysignl(x86_fp80, x86_fp80)\n"
133 "declare double @cabs([2 x double])\n"
134 "declare float @cabsf([2 x float])\n"
135 "declare x86_fp80 @cabsl([2 x x86_fp80])\n"
136 "declare double @cos(double)\n"
137 "declare float @cosf(float)\n"
138 "declare double @cosh(double)\n"
139 "declare float @coshf(float)\n"
140 "declare x86_fp80 @coshl(x86_fp80)\n"
141 "declare x86_fp80 @cosl(x86_fp80)\n"
142 "declare i8* @ctermid(i8*)\n"
143 "declare double @exp(double)\n"
144 "declare double @exp2(double)\n"
145 "declare float @exp2f(float)\n"
146 "declare x86_fp80 @exp2l(x86_fp80)\n"
147 "declare float @expf(float)\n"
148 "declare x86_fp80 @expl(x86_fp80)\n"
149 "declare double @expm1(double)\n"
150 "declare float @expm1f(float)\n"
151 "declare x86_fp80 @expm1l(x86_fp80)\n"
152 "declare double @fabs(double)\n"
153 "declare float @fabsf(float)\n"
154 "declare x86_fp80 @fabsl(x86_fp80)\n"
155 "declare i32 @fclose(%struct*)\n"
156 "declare i32 @feof(%struct*)\n"
157 "declare i32 @ferror(%struct*)\n"
158 "declare i32 @fflush(%struct*)\n"
159 "declare i32 @ffs(i32)\n"
160 "declare i32 @ffsl(i64)\n"
161 "declare i32 @ffsll(i64)\n"
162 "declare i32 @fgetc(%struct*)\n"
163 "declare i32 @fgetc_unlocked(%struct*)\n"
164 "declare i32 @fgetpos(%struct*, i64*)\n"
165 "declare i8* @fgets(i8*, i32, %struct*)\n"
166 "declare i8* @fgets_unlocked(i8*, i32, %struct*)\n"
167 "declare i32 @fileno(%struct*)\n"
168 "declare void @flockfile(%struct*)\n"
169 "declare double @floor(double)\n"
170 "declare float @floorf(float)\n"
171 "declare x86_fp80 @floorl(x86_fp80)\n"
172 "declare i32 @fls(i32)\n"
173 "declare i32 @flsl(i64)\n"
174 "declare i32 @flsll(i64)\n"
175 "declare double @fmax(double, double)\n"
176 "declare float @fmaxf(float, float)\n"
177 "declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)\n"
178 "declare double @fmin(double, double)\n"
179 "declare float @fminf(float, float)\n"
180 "declare x86_fp80 @fminl(x86_fp80, x86_fp80)\n"
181 "declare double @fmod(double, double)\n"
182 "declare float @fmodf(float, float)\n"
183 "declare x86_fp80 @fmodl(x86_fp80, x86_fp80)\n"
184 "declare i32 @fprintf(%struct*, i8*, ...)\n"
185 "declare i32 @fputc(i32, %struct*)\n"
186 "declare i32 @fputc_unlocked(i32, %struct*)\n"
187 "declare i64 @fread(i8*, i64, i64, %struct*)\n"
188 "declare i64 @fread_unlocked(i8*, i64, i64, %struct*)\n"
189 "declare void @free(i8*)\n"
190 "declare double @frexp(double, i32*)\n"
191 "declare float @frexpf(float, i32*)\n"
192 "declare x86_fp80 @frexpl(x86_fp80, i32*)\n"
193 "declare i32 @fscanf(%struct*, i8*, ...)\n"
194 "declare i32 @fseek(%struct*, i64, i32)\n"
195 "declare i32 @fseeko(%struct*, i64, i32)\n"
196 "declare i32 @fsetpos(%struct*, i64*)\n"
197 "declare i32 @fstatvfs(i32, %struct*)\n"
198 "declare i64 @ftell(%struct*)\n"
199 "declare i64 @ftello(%struct*)\n"
200 "declare i32 @ftrylockfile(%struct*)\n"
201 "declare void @funlockfile(%struct*)\n"
202 "declare i32 @getc(%struct*)\n"
203 "declare i32 @getc_unlocked(%struct*)\n"
204 "declare i32 @getchar()\n"
205 "declare i32 @getchar_unlocked()\n"
206 "declare i8* @getenv(i8*)\n"
207 "declare i32 @getitimer(i32, %struct*)\n"
208 "declare i32 @getlogin_r(i8*, i64)\n"
209 "declare %struct* @getpwnam(i8*)\n"
210 "declare i8* @gets(i8*)\n"
211 "declare i32 @gettimeofday(%struct*, i8*)\n"
212 "declare i32 @_Z7isasciii(i32)\n"
213 "declare i32 @_Z7isdigiti(i32)\n"
214 "declare i64 @labs(i64)\n"
215 "declare double @ldexp(double, i32)\n"
216 "declare float @ldexpf(float, i32)\n"
217 "declare x86_fp80 @ldexpl(x86_fp80, i32)\n"
218 "declare i64 @llabs(i64)\n"
219 "declare double @log(double)\n"
220 "declare double @log10(double)\n"
221 "declare float @log10f(float)\n"
222 "declare x86_fp80 @log10l(x86_fp80)\n"
223 "declare double @log1p(double)\n"
224 "declare float @log1pf(float)\n"
225 "declare x86_fp80 @log1pl(x86_fp80)\n"
226 "declare double @log2(double)\n"
227 "declare float @log2f(float)\n"
228 "declare x86_fp80 @log2l(x86_fp80)\n"
229 "declare double @logb(double)\n"
230 "declare float @logbf(float)\n"
231 "declare x86_fp80 @logbl(x86_fp80)\n"
232 "declare float @logf(float)\n"
233 "declare x86_fp80 @logl(x86_fp80)\n"
234 "declare i8* @malloc(i64)\n"
235 "declare i8* @memccpy(i8*, i8*, i32, i64)\n"
236 "declare i8* @memchr(i8*, i32, i64)\n"
237 "declare i32 @memcmp(i8*, i8*, i64)\n"
238 "declare i8* @memcpy(i8*, i8*, i64)\n"
239 "declare i8* @memmove(i8*, i8*, i64)\n"
240 "declare i8* @memset(i8*, i32, i64)\n"
241 "declare void @memset_pattern16(i8*, i8*, i64)\n"
242 "declare i32 @mkdir(i8*, i16)\n"
243 "declare double @modf(double, double*)\n"
244 "declare float @modff(float, float*)\n"
245 "declare x86_fp80 @modfl(x86_fp80, x86_fp80*)\n"
246 "declare double @nearbyint(double)\n"
247 "declare float @nearbyintf(float)\n"
248 "declare x86_fp80 @nearbyintl(x86_fp80)\n"
249 "declare i32 @pclose(%struct*)\n"
250 "declare void @perror(i8*)\n"
251 "declare i32 @posix_memalign(i8**, i64, i64)\n"
252 "declare double @pow(double, double)\n"
253 "declare float @powf(float, float)\n"
254 "declare x86_fp80 @powl(x86_fp80, x86_fp80)\n"
255 "declare i32 @printf(i8*, ...)\n"
256 "declare i32 @putc(i32, %struct*)\n"
257 "declare i32 @putc_unlocked(i32, %struct*)\n"
258 "declare i32 @putchar(i32)\n"
259 "declare i32 @putchar_unlocked(i32)\n"
260 "declare i32 @puts(i8*)\n"
261 "declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n"
262 "declare i64 @readlink(i8*, i8*, i64)\n"
263 "declare i8* @realloc(i8*, i64)\n"
264 "declare i8* @reallocf(i8*, i64)\n"
265 "declare i32 @remove(i8*)\n"
266 "declare i32 @rename(i8*, i8*)\n"
267 "declare void @rewind(%struct*)\n"
268 "declare double @rint(double)\n"
269 "declare float @rintf(float)\n"
270 "declare x86_fp80 @rintl(x86_fp80)\n"
271 "declare i32 @rmdir(i8*)\n"
272 "declare double @round(double)\n"
273 "declare float @roundf(float)\n"
274 "declare x86_fp80 @roundl(x86_fp80)\n"
275 "declare i32 @scanf(i8*, ...)\n"
276 "declare void @setbuf(%struct*, i8*)\n"
277 "declare i32 @setitimer(i32, %struct*, %struct*)\n"
278 "declare i32 @setvbuf(%struct*, i8*, i32, i64)\n"
279 "declare double @sin(double)\n"
280 "declare float @sinf(float)\n"
281 "declare double @sinh(double)\n"
282 "declare float @sinhf(float)\n"
283 "declare x86_fp80 @sinhl(x86_fp80)\n"
284 "declare x86_fp80 @sinl(x86_fp80)\n"
285 "declare i32 @snprintf(i8*, i64, i8*, ...)\n"
286 "declare i32 @sprintf(i8*, i8*, ...)\n"
287 "declare double @sqrt(double)\n"
288 "declare float @sqrtf(float)\n"
289 "declare x86_fp80 @sqrtl(x86_fp80)\n"
290 "declare i32 @sscanf(i8*, i8*, ...)\n"
291 "declare i32 @statvfs(i8*, %struct*)\n"
292 "declare i8* @stpcpy(i8*, i8*)\n"
293 "declare i8* @stpncpy(i8*, i8*, i64)\n"
294 "declare i32 @strcasecmp(i8*, i8*)\n"
295 "declare i8* @strcat(i8*, i8*)\n"
296 "declare i8* @strchr(i8*, i32)\n"
297 "declare i32 @strcmp(i8*, i8*)\n"
298 "declare i32 @strcoll(i8*, i8*)\n"
299 "declare i8* @strcpy(i8*, i8*)\n"
300 "declare i64 @strcspn(i8*, i8*)\n"
301 "declare i8* @strdup(i8*)\n"
302 "declare i64 @strlen(i8*)\n"
303 "declare i32 @strncasecmp(i8*, i8*, i64)\n"
304 "declare i8* @strncat(i8*, i8*, i64)\n"
305 "declare i32 @strncmp(i8*, i8*, i64)\n"
306 "declare i8* @strncpy(i8*, i8*, i64)\n"
307 "declare i8* @strndup(i8*, i64)\n"
308 "declare i64 @strnlen(i8*, i64)\n"
309 "declare i8* @strpbrk(i8*, i8*)\n"
310 "declare i8* @strrchr(i8*, i32)\n"
311 "declare i64 @strspn(i8*, i8*)\n"
312 "declare i8* @strstr(i8*, i8*)\n"
313 "declare i8* @strtok(i8*, i8*)\n"
314 "declare i8* @strtok_r(i8*, i8*, i8**)\n"
315 "declare i64 @strtol(i8*, i8**, i32)\n"
316 "declare x86_fp80 @strtold(i8*, i8**)\n"
317 "declare i64 @strtoll(i8*, i8**, i32)\n"
318 "declare i64 @strtoul(i8*, i8**, i32)\n"
319 "declare i64 @strtoull(i8*, i8**, i32)\n"
320 "declare i64 @strxfrm(i8*, i8*, i64)\n"
321 "declare double @tan(double)\n"
322 "declare float @tanf(float)\n"
323 "declare double @tanh(double)\n"
324 "declare float @tanhf(float)\n"
325 "declare x86_fp80 @tanhl(x86_fp80)\n"
326 "declare x86_fp80 @tanl(x86_fp80)\n"
327 "declare i64 @times(%struct*)\n"
328 "declare %struct* @tmpfile()\n"
329 "declare i32 @_Z7toasciii(i32)\n"
330 "declare double @trunc(double)\n"
331 "declare float @truncf(float)\n"
332 "declare x86_fp80 @truncl(x86_fp80)\n"
333 "declare i32 @uname(%struct*)\n"
334 "declare i32 @ungetc(i32, %struct*)\n"
335 "declare i32 @unlink(i8*)\n"
336 "declare i32 @utime(i8*, %struct*)\n"
337 "declare i32 @utimes(i8*, %struct*)\n"
338 "declare i8* @valloc(i64)\n"
339 "declare i32 @vfprintf(%struct*, i8*, %struct*)\n"
340 "declare i32 @vfscanf(%struct*, i8*, %struct*)\n"
341 "declare i32 @vprintf(i8*, %struct*)\n"
342 "declare i32 @vscanf(i8*, %struct*)\n"
343 "declare i32 @vsnprintf(i8*, i64, i8*, %struct*)\n"
344 "declare i32 @vsprintf(i8*, i8*, %struct*)\n"
345 "declare i32 @vsscanf(i8*, i8*, %struct*)\n"
346 "declare i64 @wcslen(i32*)\n"
347
348 // These functions were also extracted from the OS X headers, but they are
349 // available with a special name on darwin.
350 // This test uses the default TLI name instead.
351 "declare i32 @chmod(i8*, i16)\n"
352 "declare i32 @closedir(%struct*)\n"
353 "declare %struct* @fdopen(i32, i8*)\n"
354 "declare %struct* @fopen(i8*, i8*)\n"
355 "declare i32 @fputs(i8*, %struct*)\n"
356 "declare i32 @fputs_unlocked(i8*, %struct*)\n"
357 "declare i32 @fstat(i32, %struct*)\n"
358 "declare i64 @fwrite(i8*, i64, i64, %struct*)\n"
359 "declare i64 @fwrite_unlocked(i8*, i64, i64, %struct*)\n"
360 "declare i32 @lchown(i8*, i32, i32)\n"
361 "declare i32 @lstat(i8*, %struct*)\n"
362 "declare i64 @mktime(%struct*)\n"
363 "declare i32 @open(i8*, i32, ...)\n"
364 "declare %struct* @opendir(i8*)\n"
365 "declare %struct* @popen(i8*, i8*)\n"
366 "declare i64 @pread(i32, i8*, i64, i64)\n"
367 "declare i64 @pwrite(i32, i8*, i64, i64)\n"
368 "declare i64 @read(i32, i8*, i64)\n"
369 "declare i8* @realpath(i8*, i8*)\n"
370 "declare i32 @stat(i8*, %struct*)\n"
371 "declare double @strtod(i8*, i8**)\n"
372 "declare float @strtof(i8*, i8**)\n"
373 "declare i32 @system(i8*)\n"
374 "declare i32 @unsetenv(i8*)\n"
375 "declare i64 @write(i32, i8*, i64)\n"
376
377 // These functions are available on Linux but not Darwin; they only differ
378 // from their non-64 counterparts in the struct type.
379 // Use the same prototype as the non-64 variant.
380 "declare %struct* @fopen64(i8*, i8*)\n"
381 "declare i32 @fstat64(i32, %struct*)\n"
382 "declare i32 @fstatvfs64(i32, %struct*)\n"
383 "declare i32 @lstat64(i8*, %struct*)\n"
384 "declare i32 @open64(i8*, i32, ...)\n"
385 "declare i32 @stat64(i8*, %struct*)\n"
386 "declare i32 @statvfs64(i8*, %struct*)\n"
387 "declare %struct* @tmpfile64()\n"
388
389 // These functions are also -64 variants, but do differ in the type of the
390 // off_t (vs off64_t) parameter. The non-64 variants declared above used
391 // a 64-bit off_t, so, in practice, they are also equivalent.
392 "declare i32 @fseeko64(%struct*, i64, i32)\n"
393 "declare i64 @ftello64(%struct*)\n"
394
395 "declare void @_ZdaPv(i8*)\n"
396 "declare void @_ZdaPvRKSt9nothrow_t(i8*, %struct*)\n"
397 "declare void @_ZdaPvSt11align_val_t(i8*, i64)\n"
398 "declare void @_ZdaPvSt11align_val_tRKSt9nothrow_t(i8*, i64, %struct*)\n"
399 "declare void @_ZdaPvj(i8*, i32)\n"
400 "declare void @_ZdaPvm(i8*, i64)\n"
401 "declare void @_ZdlPv(i8*)\n"
402 "declare void @_ZdlPvRKSt9nothrow_t(i8*, %struct*)\n"
403 "declare void @_ZdlPvSt11align_val_t(i8*, i64)\n"
404 "declare void @_ZdlPvSt11align_val_tRKSt9nothrow_t(i8*, i64, %struct*)\n"
405 "declare void @_ZdlPvj(i8*, i32)\n"
406 "declare void @_ZdlPvm(i8*, i64)\n"
407 "declare i8* @_Znaj(i32)\n"
408 "declare i8* @_ZnajRKSt9nothrow_t(i32, %struct*)\n"
409 "declare i8* @_ZnajSt11align_val_t(i32, i32)\n"
410 "declare i8* @_ZnajSt11align_val_tRKSt9nothrow_t(i32, i32, %struct*)\n"
411 "declare i8* @_Znam(i64)\n"
412 "declare i8* @_ZnamRKSt9nothrow_t(i64, %struct*)\n"
413 "declare i8* @_ZnamSt11align_val_t(i64, i64)\n"
414 "declare i8* @_ZnamSt11align_val_tRKSt9nothrow_t(i64, i64, %struct*)\n"
415 "declare i8* @_Znwj(i32)\n"
416 "declare i8* @_ZnwjRKSt9nothrow_t(i32, %struct*)\n"
417 "declare i8* @_ZnwjSt11align_val_t(i32, i32)\n"
418 "declare i8* @_ZnwjSt11align_val_tRKSt9nothrow_t(i32, i32, %struct*)\n"
419 "declare i8* @_Znwm(i64)\n"
420 "declare i8* @_ZnwmRKSt9nothrow_t(i64, %struct*)\n"
421 "declare i8* @_ZnwmSt11align_val_t(i64, i64)\n"
422 "declare i8* @_ZnwmSt11align_val_tRKSt9nothrow_t(i64, i64, %struct*)\n"
423
424 "declare void @\"??3@YAXPEAX@Z\"(i8*)\n"
425 "declare void @\"??3@YAXPEAXAEBUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
426 "declare void @\"??3@YAXPEAX_K@Z\"(i8*, i64)\n"
427 "declare void @\"??_V@YAXPEAX@Z\"(i8*)\n"
428 "declare void @\"??_V@YAXPEAXAEBUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
429 "declare void @\"??_V@YAXPEAX_K@Z\"(i8*, i64)\n"
430 "declare i8* @\"??2@YAPAXI@Z\"(i32)\n"
431 "declare i8* @\"??2@YAPAXIABUnothrow_t@std@@@Z\"(i32, %struct*)\n"
432 "declare i8* @\"??2@YAPEAX_K@Z\"(i64)\n"
433 "declare i8* @\"??2@YAPEAX_KAEBUnothrow_t@std@@@Z\"(i64, %struct*)\n"
434 "declare i8* @\"??_U@YAPAXI@Z\"(i32)\n"
435 "declare i8* @\"??_U@YAPAXIABUnothrow_t@std@@@Z\"(i32, %struct*)\n"
436 "declare i8* @\"??_U@YAPEAX_K@Z\"(i64)\n"
437 "declare i8* @\"??_U@YAPEAX_KAEBUnothrow_t@std@@@Z\"(i64, %struct*)\n"
438
439 "declare void @\"??3@YAXPAX@Z\"(i8*)\n"
440 "declare void @\"??3@YAXPAXABUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
441 "declare void @\"??3@YAXPAXI@Z\"(i8*, i32)\n"
442 "declare void @\"??_V@YAXPAX@Z\"(i8*)\n"
443 "declare void @\"??_V@YAXPAXABUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
444 "declare void @\"??_V@YAXPAXI@Z\"(i8*, i32)\n"
445
446 // These other functions were derived from the .def C declaration.
447 "declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)\n"
448 "declare void @__cxa_guard_abort(%struct*)\n"
449 "declare i32 @__cxa_guard_acquire(%struct*)\n"
450 "declare void @__cxa_guard_release(%struct*)\n"
451
452 "declare i32 @__nvvm_reflect(i8*)\n"
453
454 "declare i8* @__memcpy_chk(i8*, i8*, i64, i64)\n"
455 "declare i8* @__memmove_chk(i8*, i8*, i64, i64)\n"
456 "declare i8* @__memset_chk(i8*, i32, i64, i64)\n"
457 "declare i8* @__stpcpy_chk(i8*, i8*, i64)\n"
458 "declare i8* @__stpncpy_chk(i8*, i8*, i64, i64)\n"
459 "declare i8* @__strcpy_chk(i8*, i8*, i64)\n"
460 "declare i8* @__strncpy_chk(i8*, i8*, i64, i64)\n"
461
462 "declare i8* @memalign(i64, i64)\n"
463 "declare i8* @mempcpy(i8*, i8*, i64)\n"
464 "declare i8* @memrchr(i8*, i32, i64)\n"
465
466 // These are similar to the FILE* fgetc/fputc.
467 "declare i32 @_IO_getc(%struct*)\n"
468 "declare i32 @_IO_putc(i32, %struct*)\n"
469
470 "declare i32 @__isoc99_scanf(i8*, ...)\n"
471 "declare i32 @__isoc99_sscanf(i8*, i8*, ...)\n"
472 "declare i8* @__strdup(i8*)\n"
473 "declare i8* @__strndup(i8*, i64)\n"
474 "declare i8* @__strtok_r(i8*, i8*, i8**)\n"
475
476 "declare double @__sqrt_finite(double)\n"
477 "declare float @__sqrtf_finite(float)\n"
478 "declare x86_fp80 @__sqrtl_finite(x86_fp80)\n"
479 "declare double @exp10(double)\n"
480 "declare float @exp10f(float)\n"
481 "declare x86_fp80 @exp10l(x86_fp80)\n"
482
483 // These printf variants have the same prototype as the non-'i' versions.
484 "declare i32 @fiprintf(%struct*, i8*, ...)\n"
485 "declare i32 @iprintf(i8*, ...)\n"
486 "declare i32 @siprintf(i8*, i8*, ...)\n"
487
488 "declare i32 @htonl(i32)\n"
489 "declare i16 @htons(i16)\n"
490 "declare i32 @ntohl(i32)\n"
491 "declare i16 @ntohs(i16)\n"
492
493 "declare i32 @isascii(i32)\n"
494 "declare i32 @isdigit(i32)\n"
495 "declare i32 @toascii(i32)\n"
496
497 // These functions were extracted from math-finite.h which provides
498 // functions similar to those in math.h, but optimized for handling
499 // finite values only.
500 "declare double @__acos_finite(double)\n"
501 "declare float @__acosf_finite(float)\n"
502 "declare x86_fp80 @__acosl_finite(x86_fp80)\n"
503 "declare double @__acosh_finite(double)\n"
504 "declare float @__acoshf_finite(float)\n"
505 "declare x86_fp80 @__acoshl_finite(x86_fp80)\n"
506 "declare double @__asin_finite(double)\n"
507 "declare float @__asinf_finite(float)\n"
508 "declare x86_fp80 @__asinl_finite(x86_fp80)\n"
509 "declare double @__atan2_finite(double, double)\n"
510 "declare float @__atan2f_finite(float, float)\n"
511 "declare x86_fp80 @__atan2l_finite(x86_fp80, x86_fp80)\n"
512 "declare double @__atanh_finite(double)\n"
513 "declare float @__atanhf_finite(float)\n"
514 "declare x86_fp80 @__atanhl_finite(x86_fp80)\n"
515 "declare double @__cosh_finite(double)\n"
516 "declare float @__coshf_finite(float)\n"
517 "declare x86_fp80 @__coshl_finite(x86_fp80)\n"
518 "declare double @__exp10_finite(double)\n"
519 "declare float @__exp10f_finite(float)\n"
520 "declare x86_fp80 @__exp10l_finite(x86_fp80)\n"
521 "declare double @__exp2_finite(double)\n"
522 "declare float @__exp2f_finite(float)\n"
523 "declare x86_fp80 @__exp2l_finite(x86_fp80)\n"
524 "declare double @__exp_finite(double)\n"
525 "declare float @__expf_finite(float)\n"
526 "declare x86_fp80 @__expl_finite(x86_fp80)\n"
527 "declare double @__log10_finite(double)\n"
528 "declare float @__log10f_finite(float)\n"
529 "declare x86_fp80 @__log10l_finite(x86_fp80)\n"
530 "declare double @__log2_finite(double)\n"
531 "declare float @__log2f_finite(float)\n"
532 "declare x86_fp80 @__log2l_finite(x86_fp80)\n"
533 "declare double @__log_finite(double)\n"
534 "declare float @__logf_finite(float)\n"
535 "declare x86_fp80 @__logl_finite(x86_fp80)\n"
536 "declare double @__pow_finite(double, double)\n"
537 "declare float @__powf_finite(float, float)\n"
538 "declare x86_fp80 @__powl_finite(x86_fp80, x86_fp80)\n"
539 "declare double @__sinh_finite(double)\n"
540 "declare float @__sinhf_finite(float)\n"
541 "declare x86_fp80 @__sinhl_finite(x86_fp80)\n"
542 );
78 // These functions use a 64-bit size_t; use the appropriate datalayout.
79 "target datalayout = \"p:64:64:64\"\n"
80
81 // Struct pointers are replaced with an opaque pointer.
82 "%struct = type opaque\n"
83
84 // These functions were extracted as-is from the OS X headers.
85 "declare double @__cospi(double)\n"
86 "declare float @__cospif(float)\n"
87 "declare { double, double } @__sincospi_stret(double)\n"
88 "declare <2 x float> @__sincospif_stret(float)\n"
89 "declare double @__sinpi(double)\n"
90 "declare float @__sinpif(float)\n"
91 "declare i32 @abs(i32)\n"
92 "declare i32 @access(i8*, i32)\n"
93 "declare double @acos(double)\n"
94 "declare float @acosf(float)\n"
95 "declare double @acosh(double)\n"
96 "declare float @acoshf(float)\n"
97 "declare x86_fp80 @acoshl(x86_fp80)\n"
98 "declare x86_fp80 @acosl(x86_fp80)\n"
99 "declare double @asin(double)\n"
100 "declare float @asinf(float)\n"
101 "declare double @asinh(double)\n"
102 "declare float @asinhf(float)\n"
103 "declare x86_fp80 @asinhl(x86_fp80)\n"
104 "declare x86_fp80 @asinl(x86_fp80)\n"
105 "declare double @atan(double)\n"
106 "declare double @atan2(double, double)\n"
107 "declare float @atan2f(float, float)\n"
108 "declare x86_fp80 @atan2l(x86_fp80, x86_fp80)\n"
109 "declare float @atanf(float)\n"
110 "declare double @atanh(double)\n"
111 "declare float @atanhf(float)\n"
112 "declare x86_fp80 @atanhl(x86_fp80)\n"
113 "declare x86_fp80 @atanl(x86_fp80)\n"
114 "declare double @atof(i8*)\n"
115 "declare i32 @atoi(i8*)\n"
116 "declare i64 @atol(i8*)\n"
117 "declare i64 @atoll(i8*)\n"
118 "declare i32 @bcmp(i8*, i8*, i64)\n"
119 "declare void @bcopy(i8*, i8*, i64)\n"
120 "declare void @bzero(i8*, i64)\n"
121 "declare i8* @calloc(i64, i64)\n"
122 "declare double @cbrt(double)\n"
123 "declare float @cbrtf(float)\n"
124 "declare x86_fp80 @cbrtl(x86_fp80)\n"
125 "declare double @ceil(double)\n"
126 "declare float @ceilf(float)\n"
127 "declare x86_fp80 @ceill(x86_fp80)\n"
128 "declare i32 @chown(i8*, i32, i32)\n"
129 "declare void @clearerr(%struct*)\n"
130 "declare double @copysign(double, double)\n"
131 "declare float @copysignf(float, float)\n"
132 "declare x86_fp80 @copysignl(x86_fp80, x86_fp80)\n"
133 "declare double @cabs([2 x double])\n"
134 "declare float @cabsf([2 x float])\n"
135 "declare x86_fp80 @cabsl([2 x x86_fp80])\n"
136 "declare double @cos(double)\n"
137 "declare float @cosf(float)\n"
138 "declare double @cosh(double)\n"
139 "declare float @coshf(float)\n"
140 "declare x86_fp80 @coshl(x86_fp80)\n"
141 "declare x86_fp80 @cosl(x86_fp80)\n"
142 "declare i8* @ctermid(i8*)\n"
143 "declare double @exp(double)\n"
144 "declare double @exp2(double)\n"
145 "declare float @exp2f(float)\n"
146 "declare x86_fp80 @exp2l(x86_fp80)\n"
147 "declare float @expf(float)\n"
148 "declare x86_fp80 @expl(x86_fp80)\n"
149 "declare double @expm1(double)\n"
150 "declare float @expm1f(float)\n"
151 "declare x86_fp80 @expm1l(x86_fp80)\n"
152 "declare double @fabs(double)\n"
153 "declare float @fabsf(float)\n"
154 "declare x86_fp80 @fabsl(x86_fp80)\n"
155 "declare i32 @fclose(%struct*)\n"
156 "declare i32 @feof(%struct*)\n"
157 "declare i32 @ferror(%struct*)\n"
158 "declare i32 @fflush(%struct*)\n"
159 "declare i32 @ffs(i32)\n"
160 "declare i32 @ffsl(i64)\n"
161 "declare i32 @ffsll(i64)\n"
162 "declare i32 @fgetc(%struct*)\n"
163 "declare i32 @fgetc_unlocked(%struct*)\n"
164 "declare i32 @fgetpos(%struct*, i64*)\n"
165 "declare i8* @fgets(i8*, i32, %struct*)\n"
166 "declare i8* @fgets_unlocked(i8*, i32, %struct*)\n"
167 "declare i32 @fileno(%struct*)\n"
168 "declare void @flockfile(%struct*)\n"
169 "declare double @floor(double)\n"
170 "declare float @floorf(float)\n"
171 "declare x86_fp80 @floorl(x86_fp80)\n"
172 "declare i32 @fls(i32)\n"
173 "declare i32 @flsl(i64)\n"
174 "declare i32 @flsll(i64)\n"
175 "declare double @fmax(double, double)\n"
176 "declare float @fmaxf(float, float)\n"
177 "declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)\n"
178 "declare double @fmin(double, double)\n"
179 "declare float @fminf(float, float)\n"
180 "declare x86_fp80 @fminl(x86_fp80, x86_fp80)\n"
181 "declare double @fmod(double, double)\n"
182 "declare float @fmodf(float, float)\n"
183 "declare x86_fp80 @fmodl(x86_fp80, x86_fp80)\n"
184 "declare i32 @fprintf(%struct*, i8*, ...)\n"
185 "declare i32 @fputc(i32, %struct*)\n"
186 "declare i32 @fputc_unlocked(i32, %struct*)\n"
187 "declare i64 @fread(i8*, i64, i64, %struct*)\n"
188 "declare i64 @fread_unlocked(i8*, i64, i64, %struct*)\n"
189 "declare void @free(i8*)\n"
190 "declare double @frexp(double, i32*)\n"
191 "declare float @frexpf(float, i32*)\n"
192 "declare x86_fp80 @frexpl(x86_fp80, i32*)\n"
193 "declare i32 @fscanf(%struct*, i8*, ...)\n"
194 "declare i32 @fseek(%struct*, i64, i32)\n"
195 "declare i32 @fseeko(%struct*, i64, i32)\n"
196 "declare i32 @fsetpos(%struct*, i64*)\n"
197 "declare i32 @fstatvfs(i32, %struct*)\n"
198 "declare i64 @ftell(%struct*)\n"
199 "declare i64 @ftello(%struct*)\n"
200 "declare i32 @ftrylockfile(%struct*)\n"
201 "declare void @funlockfile(%struct*)\n"
202 "declare i32 @getc(%struct*)\n"
203 "declare i32 @getc_unlocked(%struct*)\n"
204 "declare i32 @getchar()\n"
205 "declare i32 @getchar_unlocked()\n"
206 "declare i8* @getenv(i8*)\n"
207 "declare i32 @getitimer(i32, %struct*)\n"
208 "declare i32 @getlogin_r(i8*, i64)\n"
209 "declare %struct* @getpwnam(i8*)\n"
210 "declare i8* @gets(i8*)\n"
211 "declare i32 @gettimeofday(%struct*, i8*)\n"
212 "declare i32 @_Z7isasciii(i32)\n"
213 "declare i32 @_Z7isdigiti(i32)\n"
214 "declare i64 @labs(i64)\n"
215 "declare double @ldexp(double, i32)\n"
216 "declare float @ldexpf(float, i32)\n"
217 "declare x86_fp80 @ldexpl(x86_fp80, i32)\n"
218 "declare i64 @llabs(i64)\n"
219 "declare double @log(double)\n"
220 "declare double @log10(double)\n"
221 "declare float @log10f(float)\n"
222 "declare x86_fp80 @log10l(x86_fp80)\n"
223 "declare double @log1p(double)\n"
224 "declare float @log1pf(float)\n"
225 "declare x86_fp80 @log1pl(x86_fp80)\n"
226 "declare double @log2(double)\n"
227 "declare float @log2f(float)\n"
228 "declare x86_fp80 @log2l(x86_fp80)\n"
229 "declare double @logb(double)\n"
230 "declare float @logbf(float)\n"
231 "declare x86_fp80 @logbl(x86_fp80)\n"
232 "declare float @logf(float)\n"
233 "declare x86_fp80 @logl(x86_fp80)\n"
234 "declare i8* @malloc(i64)\n"
235 "declare i8* @memccpy(i8*, i8*, i32, i64)\n"
236 "declare i8* @memchr(i8*, i32, i64)\n"
237 "declare i32 @memcmp(i8*, i8*, i64)\n"
238 "declare i8* @memcpy(i8*, i8*, i64)\n"
239 "declare i8* @memmove(i8*, i8*, i64)\n"
240 "declare i8* @memset(i8*, i32, i64)\n"
241 "declare void @memset_pattern16(i8*, i8*, i64)\n"
242 "declare i32 @mkdir(i8*, i16)\n"
243 "declare double @modf(double, double*)\n"
244 "declare float @modff(float, float*)\n"
245 "declare x86_fp80 @modfl(x86_fp80, x86_fp80*)\n"
246 "declare double @nearbyint(double)\n"
247 "declare float @nearbyintf(float)\n"
248 "declare x86_fp80 @nearbyintl(x86_fp80)\n"
249 "declare i32 @pclose(%struct*)\n"
250 "declare void @perror(i8*)\n"
251 "declare i32 @posix_memalign(i8**, i64, i64)\n"
252 "declare double @pow(double, double)\n"
253 "declare float @powf(float, float)\n"
254 "declare x86_fp80 @powl(x86_fp80, x86_fp80)\n"
255 "declare i32 @printf(i8*, ...)\n"
256 "declare i32 @putc(i32, %struct*)\n"
257 "declare i32 @putc_unlocked(i32, %struct*)\n"
258 "declare i32 @putchar(i32)\n"
259 "declare i32 @putchar_unlocked(i32)\n"
260 "declare i32 @puts(i8*)\n"
261 "declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n"
262 "declare i64 @readlink(i8*, i8*, i64)\n"
263 "declare i8* @realloc(i8*, i64)\n"
264 "declare i8* @reallocf(i8*, i64)\n"
265 "declare i32 @remove(i8*)\n"
266 "declare i32 @rename(i8*, i8*)\n"
267 "declare void @rewind(%struct*)\n"
268 "declare double @rint(double)\n"
269 "declare float @rintf(float)\n"
270 "declare x86_fp80 @rintl(x86_fp80)\n"
271 "declare i32 @rmdir(i8*)\n"
272 "declare double @round(double)\n"
273 "declare float @roundf(float)\n"
274 "declare x86_fp80 @roundl(x86_fp80)\n"
275 "declare i32 @scanf(i8*, ...)\n"
276 "declare void @setbuf(%struct*, i8*)\n"
277 "declare i32 @setitimer(i32, %struct*, %struct*)\n"
278 "declare i32 @setvbuf(%struct*, i8*, i32, i64)\n"
279 "declare double @sin(double)\n"
280 "declare float @sinf(float)\n"
281 "declare double @sinh(double)\n"
282 "declare float @sinhf(float)\n"
283 "declare x86_fp80 @sinhl(x86_fp80)\n"
284 "declare x86_fp80 @sinl(x86_fp80)\n"
285 "declare i32 @snprintf(i8*, i64, i8*, ...)\n"
286 "declare i32 @sprintf(i8*, i8*, ...)\n"
287 "declare double @sqrt(double)\n"
288 "declare float @sqrtf(float)\n"
289 "declare x86_fp80 @sqrtl(x86_fp80)\n"
290 "declare i32 @sscanf(i8*, i8*, ...)\n"
291 "declare i32 @statvfs(i8*, %struct*)\n"
292 "declare i8* @stpcpy(i8*, i8*)\n"
293 "declare i8* @stpncpy(i8*, i8*, i64)\n"
294 "declare i32 @strcasecmp(i8*, i8*)\n"
295 "declare i8* @strcat(i8*, i8*)\n"
296 "declare i8* @strchr(i8*, i32)\n"
297 "declare i32 @strcmp(i8*, i8*)\n"
298 "declare i32 @strcoll(i8*, i8*)\n"
299 "declare i8* @strcpy(i8*, i8*)\n"
300 "declare i64 @strcspn(i8*, i8*)\n"
301 "declare i8* @strdup(i8*)\n"
302 "declare i64 @strlen(i8*)\n"
303 "declare i32 @strncasecmp(i8*, i8*, i64)\n"
304 "declare i8* @strncat(i8*, i8*, i64)\n"
305 "declare i32 @strncmp(i8*, i8*, i64)\n"
306 "declare i8* @strncpy(i8*, i8*, i64)\n"
307 "declare i8* @strndup(i8*, i64)\n"
308 "declare i64 @strnlen(i8*, i64)\n"
309 "declare i8* @strpbrk(i8*, i8*)\n"
310 "declare i8* @strrchr(i8*, i32)\n"
311 "declare i64 @strspn(i8*, i8*)\n"
312 "declare i8* @strstr(i8*, i8*)\n"
313 "declare i8* @strtok(i8*, i8*)\n"
314 "declare i8* @strtok_r(i8*, i8*, i8**)\n"
315 "declare i64 @strtol(i8*, i8**, i32)\n"
316 "declare x86_fp80 @strtold(i8*, i8**)\n"
317 "declare i64 @strtoll(i8*, i8**, i32)\n"
318 "declare i64 @strtoul(i8*, i8**, i32)\n"
319 "declare i64 @strtoull(i8*, i8**, i32)\n"
320 "declare i64 @strxfrm(i8*, i8*, i64)\n"
321 "declare double @tan(double)\n"
322 "declare float @tanf(float)\n"
323 "declare double @tanh(double)\n"
324 "declare float @tanhf(float)\n"
325 "declare x86_fp80 @tanhl(x86_fp80)\n"
326 "declare x86_fp80 @tanl(x86_fp80)\n"
327 "declare i64 @times(%struct*)\n"
328 "declare %struct* @tmpfile()\n"
329 "declare i32 @_Z7toasciii(i32)\n"
330 "declare double @trunc(double)\n"
331 "declare float @truncf(float)\n"
332 "declare x86_fp80 @truncl(x86_fp80)\n"
333 "declare i32 @uname(%struct*)\n"
334 "declare i32 @ungetc(i32, %struct*)\n"
335 "declare i32 @unlink(i8*)\n"
336 "declare i32 @utime(i8*, %struct*)\n"
337 "declare i32 @utimes(i8*, %struct*)\n"
338 "declare i8* @valloc(i64)\n"
339 "declare i32 @vfprintf(%struct*, i8*, %struct*)\n"
340 "declare i32 @vfscanf(%struct*, i8*, %struct*)\n"
341 "declare i32 @vprintf(i8*, %struct*)\n"
342 "declare i32 @vscanf(i8*, %struct*)\n"
343 "declare i32 @vsnprintf(i8*, i64, i8*, %struct*)\n"
344 "declare i32 @vsprintf(i8*, i8*, %struct*)\n"
345 "declare i32 @vsscanf(i8*, i8*, %struct*)\n"
346 "declare i64 @wcslen(i32*)\n"
347 "declare i32 @fork()\n"
348 "declare i32 @execl(i8*, i8*, ...)\n"
349 "declare i32 @execle(i8*, i8*, ...)\n"
350 "declare i32 @execlp(i8*, i8*, ...)\n"
351 "declare i32 @execv(i8*, i8**)\n"
352 "declare i32 @execvP(i8*, i8*, i8**)\n"
353 "declare i32 @execve(i8*, i8**, i8**)\n"
354 "declare i32 @execvp(i8*, i8**)\n"
355 "declare i32 @execvpe(i8*, i8**, i8**)\n"
356
357 // These functions were also extracted from the OS X headers, but they are
358 // available with a special name on darwin.
359 // This test uses the default TLI name instead.
360 "declare i32 @chmod(i8*, i16)\n"
361 "declare i32 @closedir(%struct*)\n"
362 "declare %struct* @fdopen(i32, i8*)\n"
363 "declare %struct* @fopen(i8*, i8*)\n"
364 "declare i32 @fputs(i8*, %struct*)\n"
365 "declare i32 @fputs_unlocked(i8*, %struct*)\n"
366 "declare i32 @fstat(i32, %struct*)\n"
367 "declare i64 @fwrite(i8*, i64, i64, %struct*)\n"
368 "declare i64 @fwrite_unlocked(i8*, i64, i64, %struct*)\n"
369 "declare i32 @lchown(i8*, i32, i32)\n"
370 "declare i32 @lstat(i8*, %struct*)\n"
371 "declare i64 @mktime(%struct*)\n"
372 "declare i32 @open(i8*, i32, ...)\n"
373 "declare %struct* @opendir(i8*)\n"
374 "declare %struct* @popen(i8*, i8*)\n"
375 "declare i64 @pread(i32, i8*, i64, i64)\n"
376 "declare i64 @pwrite(i32, i8*, i64, i64)\n"
377 "declare i64 @read(i32, i8*, i64)\n"
378 "declare i8* @realpath(i8*, i8*)\n"
379 "declare i32 @stat(i8*, %struct*)\n"
380 "declare double @strtod(i8*, i8**)\n"
381 "declare float @strtof(i8*, i8**)\n"
382 "declare i32 @system(i8*)\n"
383 "declare i32 @unsetenv(i8*)\n"
384 "declare i64 @write(i32, i8*, i64)\n"
385
386 // These functions are available on Linux but not Darwin; they only differ
387 // from their non-64 counterparts in the struct type.
388 // Use the same prototype as the non-64 variant.
389 "declare %struct* @fopen64(i8*, i8*)\n"
390 "declare i32 @fstat64(i32, %struct*)\n"
391 "declare i32 @fstatvfs64(i32, %struct*)\n"
392 "declare i32 @lstat64(i8*, %struct*)\n"
393 "declare i32 @open64(i8*, i32, ...)\n"
394 "declare i32 @stat64(i8*, %struct*)\n"
395 "declare i32 @statvfs64(i8*, %struct*)\n"
396 "declare %struct* @tmpfile64()\n"
397
398 // These functions are also -64 variants, but do differ in the type of the
399 // off_t (vs off64_t) parameter. The non-64 variants declared above used
400 // a 64-bit off_t, so, in practice, they are also equivalent.
401 "declare i32 @fseeko64(%struct*, i64, i32)\n"
402 "declare i64 @ftello64(%struct*)\n"
403
404 "declare void @_ZdaPv(i8*)\n"
405 "declare void @_ZdaPvRKSt9nothrow_t(i8*, %struct*)\n"
406 "declare void @_ZdaPvSt11align_val_t(i8*, i64)\n"
407 "declare void @_ZdaPvSt11align_val_tRKSt9nothrow_t(i8*, i64, %struct*)\n"
408 "declare void @_ZdaPvj(i8*, i32)\n"
409 "declare void @_ZdaPvm(i8*, i64)\n"
410 "declare void @_ZdlPv(i8*)\n"
411 "declare void @_ZdlPvRKSt9nothrow_t(i8*, %struct*)\n"
412 "declare void @_ZdlPvSt11align_val_t(i8*, i64)\n"
413 "declare void @_ZdlPvSt11align_val_tRKSt9nothrow_t(i8*, i64, %struct*)\n"
414 "declare void @_ZdlPvj(i8*, i32)\n"
415 "declare void @_ZdlPvm(i8*, i64)\n"
416 "declare i8* @_Znaj(i32)\n"
417 "declare i8* @_ZnajRKSt9nothrow_t(i32, %struct*)\n"
418 "declare i8* @_ZnajSt11align_val_t(i32, i32)\n"
419 "declare i8* @_ZnajSt11align_val_tRKSt9nothrow_t(i32, i32, %struct*)\n"
420 "declare i8* @_Znam(i64)\n"
421 "declare i8* @_ZnamRKSt9nothrow_t(i64, %struct*)\n"
422 "declare i8* @_ZnamSt11align_val_t(i64, i64)\n"
423 "declare i8* @_ZnamSt11align_val_tRKSt9nothrow_t(i64, i64, %struct*)\n"
424 "declare i8* @_Znwj(i32)\n"
425 "declare i8* @_ZnwjRKSt9nothrow_t(i32, %struct*)\n"
426 "declare i8* @_ZnwjSt11align_val_t(i32, i32)\n"
427 "declare i8* @_ZnwjSt11align_val_tRKSt9nothrow_t(i32, i32, %struct*)\n"
428 "declare i8* @_Znwm(i64)\n"
429 "declare i8* @_ZnwmRKSt9nothrow_t(i64, %struct*)\n"
430 "declare i8* @_ZnwmSt11align_val_t(i64, i64)\n"
431 "declare i8* @_ZnwmSt11align_val_tRKSt9nothrow_t(i64, i64, %struct*)\n"
432
433 "declare void @\"??3@YAXPEAX@Z\"(i8*)\n"
434 "declare void @\"??3@YAXPEAXAEBUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
435 "declare void @\"??3@YAXPEAX_K@Z\"(i8*, i64)\n"
436 "declare void @\"??_V@YAXPEAX@Z\"(i8*)\n"
437 "declare void @\"??_V@YAXPEAXAEBUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
438 "declare void @\"??_V@YAXPEAX_K@Z\"(i8*, i64)\n"
439 "declare i8* @\"??2@YAPAXI@Z\"(i32)\n"
440 "declare i8* @\"??2@YAPAXIABUnothrow_t@std@@@Z\"(i32, %struct*)\n"
441 "declare i8* @\"??2@YAPEAX_K@Z\"(i64)\n"
442 "declare i8* @\"??2@YAPEAX_KAEBUnothrow_t@std@@@Z\"(i64, %struct*)\n"
443 "declare i8* @\"??_U@YAPAXI@Z\"(i32)\n"
444 "declare i8* @\"??_U@YAPAXIABUnothrow_t@std@@@Z\"(i32, %struct*)\n"
445 "declare i8* @\"??_U@YAPEAX_K@Z\"(i64)\n"
446 "declare i8* @\"??_U@YAPEAX_KAEBUnothrow_t@std@@@Z\"(i64, %struct*)\n"
447
448 "declare void @\"??3@YAXPAX@Z\"(i8*)\n"
449 "declare void @\"??3@YAXPAXABUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
450 "declare void @\"??3@YAXPAXI@Z\"(i8*, i32)\n"
451 "declare void @\"??_V@YAXPAX@Z\"(i8*)\n"
452 "declare void @\"??_V@YAXPAXABUnothrow_t@std@@@Z\"(i8*, %struct*)\n"
453 "declare void @\"??_V@YAXPAXI@Z\"(i8*, i32)\n"
454
455 // These other functions were derived from the .def C declaration.
456 "declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)\n"
457 "declare void @__cxa_guard_abort(%struct*)\n"
458 "declare i32 @__cxa_guard_acquire(%struct*)\n"
459 "declare void @__cxa_guard_release(%struct*)\n"
460
461 "declare i32 @__nvvm_reflect(i8*)\n"
462
463 "declare i8* @__memcpy_chk(i8*, i8*, i64, i64)\n"
464 "declare i8* @__memmove_chk(i8*, i8*, i64, i64)\n"
465 "declare i8* @__memset_chk(i8*, i32, i64, i64)\n"
466 "declare i8* @__stpcpy_chk(i8*, i8*, i64)\n"
467 "declare i8* @__stpncpy_chk(i8*, i8*, i64, i64)\n"
468 "declare i8* @__strcpy_chk(i8*, i8*, i64)\n"
469 "declare i8* @__strncpy_chk(i8*, i8*, i64, i64)\n"
470
471 "declare i8* @memalign(i64, i64)\n"
472 "declare i8* @mempcpy(i8*, i8*, i64)\n"
473 "declare i8* @memrchr(i8*, i32, i64)\n"
474
475 // These are similar to the FILE* fgetc/fputc.
476 "declare i32 @_IO_getc(%struct*)\n"
477 "declare i32 @_IO_putc(i32, %struct*)\n"
478
479 "declare i32 @__isoc99_scanf(i8*, ...)\n"
480 "declare i32 @__isoc99_sscanf(i8*, i8*, ...)\n"
481 "declare i8* @__strdup(i8*)\n"
482 "declare i8* @__strndup(i8*, i64)\n"
483 "declare i8* @__strtok_r(i8*, i8*, i8**)\n"
484
485 "declare double @__sqrt_finite(double)\n"
486 "declare float @__sqrtf_finite(float)\n"
487 "declare x86_fp80 @__sqrtl_finite(x86_fp80)\n"
488 "declare double @exp10(double)\n"
489 "declare float @exp10f(float)\n"
490 "declare x86_fp80 @exp10l(x86_fp80)\n"
491
492 // These printf variants have the same prototype as the non-'i' versions.
493 "declare i32 @fiprintf(%struct*, i8*, ...)\n"
494 "declare i32 @iprintf(i8*, ...)\n"
495 "declare i32 @siprintf(i8*, i8*, ...)\n"
496
497 "declare i32 @htonl(i32)\n"
498 "declare i16 @htons(i16)\n"
499 "declare i32 @ntohl(i32)\n"
500 "declare i16 @ntohs(i16)\n"
501
502 "declare i32 @isascii(i32)\n"
503 "declare i32 @isdigit(i32)\n"
504 "declare i32 @toascii(i32)\n"
505
506 // These functions were extracted from math-finite.h which provides
507 // functions similar to those in math.h, but optimized for handling
508 // finite values only.
509 "declare double @__acos_finite(double)\n"
510 "declare float @__acosf_finite(float)\n"
511 "declare x86_fp80 @__acosl_finite(x86_fp80)\n"
512 "declare double @__acosh_finite(double)\n"
513 "declare float @__acoshf_finite(float)\n"
514 "declare x86_fp80 @__acoshl_finite(x86_fp80)\n"
515 "declare double @__asin_finite(double)\n"
516 "declare float @__asinf_finite(float)\n"
517 "declare x86_fp80 @__asinl_finite(x86_fp80)\n"
518 "declare double @__atan2_finite(double, double)\n"
519 "declare float @__atan2f_finite(float, float)\n"
520 "declare x86_fp80 @__atan2l_finite(x86_fp80, x86_fp80)\n"
521 "declare double @__atanh_finite(double)\n"
522 "declare float @__atanhf_finite(float)\n"
523 "declare x86_fp80 @__atanhl_finite(x86_fp80)\n"
524 "declare double @__cosh_finite(double)\n"
525 "declare float @__coshf_finite(float)\n"
526 "declare x86_fp80 @__coshl_finite(x86_fp80)\n"
527 "declare double @__exp10_finite(double)\n"
528 "declare float @__exp10f_finite(float)\n"
529 "declare x86_fp80 @__exp10l_finite(x86_fp80)\n"
530 "declare double @__exp2_finite(double)\n"
531 "declare float @__exp2f_finite(float)\n"
532 "declare x86_fp80 @__exp2l_finite(x86_fp80)\n"
533 "declare double @__exp_finite(double)\n"
534 "declare float @__expf_finite(float)\n"
535 "declare x86_fp80 @__expl_finite(x86_fp80)\n"
536 "declare double @__log10_finite(double)\n"
537 "declare float @__log10f_finite(float)\n"
538 "declare x86_fp80 @__log10l_finite(x86_fp80)\n"
539 "declare double @__log2_finite(double)\n"
540 "declare float @__log2f_finite(float)\n"
541 "declare x86_fp80 @__log2l_finite(x86_fp80)\n"
542 "declare double @__log_finite(double)\n"
543 "declare float @__logf_finite(float)\n"
544 "declare x86_fp80 @__logl_finite(x86_fp80)\n"
545 "declare double @__pow_finite(double, double)\n"
546 "declare float @__powf_finite(float, float)\n"
547 "declare x86_fp80 @__powl_finite(x86_fp80, x86_fp80)\n"
548 "declare double @__sinh_finite(double)\n"
549 "declare float @__sinhf_finite(float)\n"
550 "declare x86_fp80 @__sinhl_finite(x86_fp80)\n"
551 );
543552
544553 for (unsigned FI = 0; FI != LibFunc::NumLibFuncs; ++FI) {
545554 LibFunc LF = (LibFunc)FI;