Home | History | Annotate | Download | only in InferFunctionAttrs
      1 ; RUN: opt < %s -mtriple=x86_64-- -inferattrs -S | FileCheck %s
      2 ; RUN: opt < %s -mtriple=x86_64-- -passes=inferattrs -S | FileCheck %s
      3 ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck -check-prefix=CHECK -check-prefix=CHECK-DARWIN %s
      4 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -inferattrs -S | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LINUX %s
      5 ; RUN: opt < %s -mtriple=nvptx -inferattrs -S | FileCheck -check-prefix=CHECK-NVPTX %s
      6 
      7 ; operator new routines
      8 declare i8* @_Znwj(i64)
      9 ; CHECK: declare noalias nonnull i8* @_Znwj(i64)
     10 declare i8* @_Znwm(i64)
     11 ; CHECK: declare noalias nonnull i8* @_Znwm(i64)
     12 
     13 declare i32 @__nvvm_reflect(i8*)
     14 ; CHECK-NVPTX: declare i32 @__nvvm_reflect(i8*) [[G0:#[0-9]+]]
     15 ; CHECK-NVPTX: attributes [[G0]] = { nounwind readnone }
     16 
     17 
     18 ; Check all the libc functions (thereby also exercising the prototype check).
     19 ; Note that it's OK to modify these as attributes might be missing. These checks
     20 ; reflect the currently inferred attributes.
     21 
     22 ; Use an opaque pointer type for all the (possibly opaque) structs.
     23 %opaque = type opaque
     24 
     25 ; CHECK: declare double @__cospi(double)
     26 declare double @__cospi(double)
     27 
     28 ; CHECK: declare float @__cospif(float)
     29 declare float @__cospif(float)
     30 
     31 ; CHECK: declare double @__sinpi(double)
     32 declare double @__sinpi(double)
     33 
     34 ; CHECK: declare float @__sinpif(float)
     35 declare float @__sinpif(float)
     36 
     37 ; CHECK: declare i32 @abs(i32)
     38 declare i32 @abs(i32)
     39 
     40 ; CHECK: declare i32 @access(i8* nocapture readonly, i32) [[G0:#[0-9]+]]
     41 declare i32 @access(i8*, i32)
     42 
     43 ; CHECK: declare double @acos(double)
     44 declare double @acos(double)
     45 
     46 ; CHECK: declare float @acosf(float)
     47 declare float @acosf(float)
     48 
     49 ; CHECK: declare double @acosh(double)
     50 declare double @acosh(double)
     51 
     52 ; CHECK: declare float @acoshf(float)
     53 declare float @acoshf(float)
     54 
     55 ; CHECK: declare x86_fp80 @acoshl(x86_fp80)
     56 declare x86_fp80 @acoshl(x86_fp80)
     57 
     58 ; CHECK: declare x86_fp80 @acosl(x86_fp80)
     59 declare x86_fp80 @acosl(x86_fp80)
     60 
     61 ; CHECK: declare double @asin(double)
     62 declare double @asin(double)
     63 
     64 ; CHECK: declare float @asinf(float)
     65 declare float @asinf(float)
     66 
     67 ; CHECK: declare double @asinh(double)
     68 declare double @asinh(double)
     69 
     70 ; CHECK: declare float @asinhf(float)
     71 declare float @asinhf(float)
     72 
     73 ; CHECK: declare x86_fp80 @asinhl(x86_fp80)
     74 declare x86_fp80 @asinhl(x86_fp80)
     75 
     76 ; CHECK: declare x86_fp80 @asinl(x86_fp80)
     77 declare x86_fp80 @asinl(x86_fp80)
     78 
     79 ; CHECK: declare double @atan(double)
     80 declare double @atan(double)
     81 
     82 ; CHECK: declare double @atan2(double, double)
     83 declare double @atan2(double, double)
     84 
     85 ; CHECK: declare float @atan2f(float, float)
     86 declare float @atan2f(float, float)
     87 
     88 ; CHECK: declare x86_fp80 @atan2l(x86_fp80, x86_fp80)
     89 declare x86_fp80 @atan2l(x86_fp80, x86_fp80)
     90 
     91 ; CHECK: declare float @atanf(float)
     92 declare float @atanf(float)
     93 
     94 ; CHECK: declare double @atanh(double)
     95 declare double @atanh(double)
     96 
     97 ; CHECK: declare float @atanhf(float)
     98 declare float @atanhf(float)
     99 
    100 ; CHECK: declare x86_fp80 @atanhl(x86_fp80)
    101 declare x86_fp80 @atanhl(x86_fp80)
    102 
    103 ; CHECK: declare x86_fp80 @atanl(x86_fp80)
    104 declare x86_fp80 @atanl(x86_fp80)
    105 
    106 ; CHECK: declare double @atof(i8* nocapture) [[G1:#[0-9]+]]
    107 declare double @atof(i8*)
    108 
    109 ; CHECK: declare i32 @atoi(i8* nocapture) [[G1]]
    110 declare i32 @atoi(i8*)
    111 
    112 ; CHECK: declare i64 @atol(i8* nocapture) [[G1]]
    113 declare i64 @atol(i8*)
    114 
    115 ; CHECK: declare i64 @atoll(i8* nocapture) [[G1]]
    116 declare i64 @atoll(i8*)
    117 
    118 ; CHECK: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[G1]]
    119 declare i32 @bcmp(i8*, i8*, i64)
    120 
    121 ; CHECK: declare void @bcopy(i8* nocapture readonly, i8* nocapture, i64) [[G0]]
    122 declare void @bcopy(i8*, i8*, i64)
    123 
    124 ; CHECK: declare void @bzero(i8* nocapture, i64) [[G0]]
    125 declare void @bzero(i8*, i64)
    126 
    127 ; CHECK: declare noalias i8* @calloc(i64, i64) [[G0]]
    128 declare i8* @calloc(i64, i64)
    129 
    130 ; CHECK: declare double @cbrt(double)
    131 declare double @cbrt(double)
    132 
    133 ; CHECK: declare float @cbrtf(float)
    134 declare float @cbrtf(float)
    135 
    136 ; CHECK: declare x86_fp80 @cbrtl(x86_fp80)
    137 declare x86_fp80 @cbrtl(x86_fp80)
    138 
    139 ; CHECK: declare double @ceil(double)
    140 declare double @ceil(double)
    141 
    142 ; CHECK: declare float @ceilf(float)
    143 declare float @ceilf(float)
    144 
    145 ; CHECK: declare x86_fp80 @ceill(x86_fp80)
    146 declare x86_fp80 @ceill(x86_fp80)
    147 
    148 ; CHECK: declare i32 @chmod(i8* nocapture readonly, i16 zeroext) [[G0]]
    149 declare i32 @chmod(i8*, i16 zeroext)
    150 
    151 ; CHECK: declare i32 @chown(i8* nocapture readonly, i32, i32) [[G0]]
    152 declare i32 @chown(i8*, i32, i32)
    153 
    154 ; CHECK: declare void @clearerr(%opaque* nocapture) [[G0]]
    155 declare void @clearerr(%opaque*)
    156 
    157 ; CHECK: declare i32 @closedir(%opaque* nocapture) [[G0]]
    158 declare i32 @closedir(%opaque*)
    159 
    160 ; CHECK: declare double @copysign(double, double)
    161 declare double @copysign(double, double)
    162 
    163 ; CHECK: declare float @copysignf(float, float)
    164 declare float @copysignf(float, float)
    165 
    166 ; CHECK: declare x86_fp80 @copysignl(x86_fp80, x86_fp80)
    167 declare x86_fp80 @copysignl(x86_fp80, x86_fp80)
    168 
    169 ; CHECK: declare double @cos(double)
    170 declare double @cos(double)
    171 
    172 ; CHECK: declare float @cosf(float)
    173 declare float @cosf(float)
    174 
    175 ; CHECK: declare double @cosh(double)
    176 declare double @cosh(double)
    177 
    178 ; CHECK: declare float @coshf(float)
    179 declare float @coshf(float)
    180 
    181 ; CHECK: declare x86_fp80 @coshl(x86_fp80)
    182 declare x86_fp80 @coshl(x86_fp80)
    183 
    184 ; CHECK: declare x86_fp80 @cosl(x86_fp80)
    185 declare x86_fp80 @cosl(x86_fp80)
    186 
    187 ; CHECK: declare i8* @ctermid(i8* nocapture) [[G0]]
    188 declare i8* @ctermid(i8*)
    189 
    190 ; CHECK: declare double @exp(double)
    191 declare double @exp(double)
    192 
    193 ; CHECK: declare double @exp2(double)
    194 declare double @exp2(double)
    195 
    196 ; CHECK: declare float @exp2f(float)
    197 declare float @exp2f(float)
    198 
    199 ; CHECK: declare x86_fp80 @exp2l(x86_fp80)
    200 declare x86_fp80 @exp2l(x86_fp80)
    201 
    202 ; CHECK: declare float @expf(float)
    203 declare float @expf(float)
    204 
    205 ; CHECK: declare x86_fp80 @expl(x86_fp80)
    206 declare x86_fp80 @expl(x86_fp80)
    207 
    208 ; CHECK: declare double @expm1(double)
    209 declare double @expm1(double)
    210 
    211 ; CHECK: declare float @expm1f(float)
    212 declare float @expm1f(float)
    213 
    214 ; CHECK: declare x86_fp80 @expm1l(x86_fp80)
    215 declare x86_fp80 @expm1l(x86_fp80)
    216 
    217 ; CHECK: declare double @fabs(double)
    218 declare double @fabs(double)
    219 
    220 ; CHECK: declare float @fabsf(float)
    221 declare float @fabsf(float)
    222 
    223 ; CHECK: declare x86_fp80 @fabsl(x86_fp80)
    224 declare x86_fp80 @fabsl(x86_fp80)
    225 
    226 ; CHECK: declare i32 @fclose(%opaque* nocapture) [[G0]]
    227 declare i32 @fclose(%opaque*)
    228 
    229 ; CHECK: declare noalias %opaque* @fdopen(i32, i8* nocapture readonly) [[G0]]
    230 declare %opaque* @fdopen(i32, i8*)
    231 
    232 ; CHECK: declare i32 @feof(%opaque* nocapture) [[G0]]
    233 declare i32 @feof(%opaque*)
    234 
    235 ; CHECK: declare i32 @ferror(%opaque* nocapture) [[G1]]
    236 declare i32 @ferror(%opaque*)
    237 
    238 ; CHECK: declare i32 @fflush(%opaque* nocapture) [[G0]]
    239 declare i32 @fflush(%opaque*)
    240 
    241 ; CHECK: declare i32 @ffs(i32)
    242 declare i32 @ffs(i32)
    243 
    244 ; CHECK: declare i32 @ffsl(i64)
    245 declare i32 @ffsl(i64)
    246 
    247 ; CHECK: declare i32 @ffsll(i64)
    248 declare i32 @ffsll(i64)
    249 
    250 ; CHECK: declare i32 @fgetc(%opaque* nocapture) [[G0]]
    251 declare i32 @fgetc(%opaque*)
    252 
    253 ; CHECK: declare i32 @fgetpos(%opaque* nocapture, i64* nocapture) [[G0]]
    254 declare i32 @fgetpos(%opaque*, i64*)
    255 
    256 ; CHECK: declare i8* @fgets(i8*, i32, %opaque* nocapture) [[G0]]
    257 declare i8* @fgets(i8*, i32, %opaque*)
    258 
    259 ; CHECK: declare i32 @fileno(%opaque* nocapture) [[G0]]
    260 declare i32 @fileno(%opaque*)
    261 
    262 ; CHECK: declare void @flockfile(%opaque* nocapture) [[G0]]
    263 declare void @flockfile(%opaque*)
    264 
    265 ; CHECK: declare double @floor(double)
    266 declare double @floor(double)
    267 
    268 ; CHECK: declare float @floorf(float)
    269 declare float @floorf(float)
    270 
    271 ; CHECK: declare x86_fp80 @floorl(x86_fp80)
    272 declare x86_fp80 @floorl(x86_fp80)
    273 
    274 ; CHECK: declare i32 @fls(i32)
    275 declare i32 @fls(i32)
    276 
    277 ; CHECK: declare i32 @flsl(i64)
    278 declare i32 @flsl(i64)
    279 
    280 ; CHECK: declare i32 @flsll(i64)
    281 declare i32 @flsll(i64)
    282 
    283 ; CHECK: declare double @fmax(double, double)
    284 declare double @fmax(double, double)
    285 
    286 ; CHECK: declare float @fmaxf(float, float)
    287 declare float @fmaxf(float, float)
    288 
    289 ; CHECK: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)
    290 declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)
    291 
    292 ; CHECK: declare double @fmin(double, double)
    293 declare double @fmin(double, double)
    294 
    295 ; CHECK: declare float @fminf(float, float)
    296 declare float @fminf(float, float)
    297 
    298 ; CHECK: declare x86_fp80 @fminl(x86_fp80, x86_fp80)
    299 declare x86_fp80 @fminl(x86_fp80, x86_fp80)
    300 
    301 ; CHECK: declare double @fmod(double, double)
    302 declare double @fmod(double, double)
    303 
    304 ; CHECK: declare float @fmodf(float, float)
    305 declare float @fmodf(float, float)
    306 
    307 ; CHECK: declare x86_fp80 @fmodl(x86_fp80, x86_fp80)
    308 declare x86_fp80 @fmodl(x86_fp80, x86_fp80)
    309 
    310 ; CHECK: declare noalias %opaque* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0]]
    311 declare %opaque* @fopen(i8*, i8*)
    312 
    313 ; CHECK: declare i32 @fprintf(%opaque* nocapture, i8* nocapture readonly, ...) [[G0]]
    314 declare i32 @fprintf(%opaque*, i8*, ...)
    315 
    316 ; CHECK: declare i32 @fputc(i32, %opaque* nocapture) [[G0]]
    317 declare i32 @fputc(i32, %opaque*)
    318 
    319 ; CHECK: declare i32 @fputs(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    320 declare i32 @fputs(i8*, %opaque*)
    321 
    322 ; CHECK: declare i64 @fread(i8* nocapture, i64, i64, %opaque* nocapture) [[G0]]
    323 declare i64 @fread(i8*, i64, i64, %opaque*)
    324 
    325 ; CHECK: declare void @free(i8* nocapture) [[G0]]
    326 declare void @free(i8*)
    327 
    328 ; CHECK: declare double @frexp(double, i32* nocapture) [[G0]]
    329 declare double @frexp(double, i32*)
    330 
    331 ; CHECK: declare float @frexpf(float, i32* nocapture) [[G0]]
    332 declare float @frexpf(float, i32*)
    333 
    334 ; CHECK: declare x86_fp80 @frexpl(x86_fp80, i32* nocapture) [[G0]]
    335 declare x86_fp80 @frexpl(x86_fp80, i32*)
    336 
    337 ; CHECK: declare i32 @fscanf(%opaque* nocapture, i8* nocapture readonly, ...) [[G0]]
    338 declare i32 @fscanf(%opaque*, i8*, ...)
    339 
    340 ; CHECK: declare i32 @fseek(%opaque* nocapture, i64, i32) [[G0]]
    341 declare i32 @fseek(%opaque*, i64, i32)
    342 
    343 ; CHECK: declare i32 @fseeko(%opaque* nocapture, i64, i32) [[G0]]
    344 declare i32 @fseeko(%opaque*, i64, i32)
    345 
    346 ; CHECK-LINUX: declare i32 @fseeko64(%opaque* nocapture, i64, i32) [[G0]]
    347 declare i32 @fseeko64(%opaque*, i64, i32)
    348 
    349 ; CHECK: declare i32 @fsetpos(%opaque* nocapture, i64*) [[G0]]
    350 declare i32 @fsetpos(%opaque*, i64*)
    351 
    352 ; CHECK: declare i32 @fstat(i32, %opaque* nocapture) [[G0]]
    353 declare i32 @fstat(i32, %opaque*)
    354 
    355 ; CHECK-LINUX: declare i32 @fstat64(i32, %opaque* nocapture) [[G0]]
    356 declare i32 @fstat64(i32, %opaque*)
    357 
    358 ; CHECK: declare i32 @fstatvfs(i32, %opaque* nocapture) [[G0]]
    359 declare i32 @fstatvfs(i32, %opaque*)
    360 
    361 ; CHECK-LINUX: declare i32 @fstatvfs64(i32, %opaque* nocapture) [[G0]]
    362 declare i32 @fstatvfs64(i32, %opaque*)
    363 
    364 ; CHECK: declare i64 @ftell(%opaque* nocapture) [[G0]]
    365 declare i64 @ftell(%opaque*)
    366 
    367 ; CHECK: declare i64 @ftello(%opaque* nocapture) [[G0]]
    368 declare i64 @ftello(%opaque*)
    369 
    370 ; CHECK-LINUX: declare i64 @ftello64(%opaque* nocapture) [[G0]]
    371 declare i64 @ftello64(%opaque*)
    372 
    373 ; CHECK: declare i32 @ftrylockfile(%opaque* nocapture) [[G0]]
    374 declare i32 @ftrylockfile(%opaque*)
    375 
    376 ; CHECK: declare void @funlockfile(%opaque* nocapture) [[G0]]
    377 declare void @funlockfile(%opaque*)
    378 
    379 ; CHECK: declare i64 @fwrite(i8* nocapture, i64, i64, %opaque* nocapture) [[G0]]
    380 declare i64 @fwrite(i8*, i64, i64, %opaque*)
    381 
    382 ; CHECK: declare i32 @getc(%opaque* nocapture) [[G0]]
    383 declare i32 @getc(%opaque*)
    384 
    385 ; CHECK: declare i32 @getc_unlocked(%opaque* nocapture) [[G0]]
    386 declare i32 @getc_unlocked(%opaque*)
    387 
    388 ; CHECK: declare i32 @getchar()
    389 declare i32 @getchar()
    390 
    391 ; CHECK: declare i8* @getenv(i8* nocapture) [[G1]]
    392 declare i8* @getenv(i8*)
    393 
    394 ; CHECK: declare i32 @getitimer(i32, %opaque* nocapture) [[G0]]
    395 declare i32 @getitimer(i32, %opaque*)
    396 
    397 ; CHECK: declare i32 @getlogin_r(i8* nocapture, i64) [[G0]]
    398 declare i32 @getlogin_r(i8*, i64)
    399 
    400 ; CHECK: declare %opaque* @getpwnam(i8* nocapture readonly) [[G0]]
    401 declare %opaque* @getpwnam(i8*)
    402 
    403 ; CHECK: declare i8* @gets(i8*)
    404 declare i8* @gets(i8*)
    405 
    406 ; CHECK: declare i32 @gettimeofday(%opaque* nocapture, i8* nocapture) [[G0]]
    407 declare i32 @gettimeofday(%opaque*, i8*)
    408 
    409 ; CHECK: declare i32 @isascii(i32)
    410 declare i32 @isascii(i32)
    411 
    412 ; CHECK: declare i32 @isdigit(i32)
    413 declare i32 @isdigit(i32)
    414 
    415 ; CHECK: declare i64 @labs(i64)
    416 declare i64 @labs(i64)
    417 
    418 ; CHECK: declare i32 @lchown(i8* nocapture readonly, i32, i32) [[G0]]
    419 declare i32 @lchown(i8*, i32, i32)
    420 
    421 ; CHECK: declare double @ldexp(double, i32)
    422 declare double @ldexp(double, i32)
    423 
    424 ; CHECK: declare float @ldexpf(float, i32)
    425 declare float @ldexpf(float, i32)
    426 
    427 ; CHECK: declare x86_fp80 @ldexpl(x86_fp80, i32)
    428 declare x86_fp80 @ldexpl(x86_fp80, i32)
    429 
    430 ; CHECK: declare i64 @llabs(i64)
    431 declare i64 @llabs(i64)
    432 
    433 ; CHECK: declare double @log(double)
    434 declare double @log(double)
    435 
    436 ; CHECK: declare double @log10(double)
    437 declare double @log10(double)
    438 
    439 ; CHECK: declare float @log10f(float)
    440 declare float @log10f(float)
    441 
    442 ; CHECK: declare x86_fp80 @log10l(x86_fp80)
    443 declare x86_fp80 @log10l(x86_fp80)
    444 
    445 ; CHECK: declare double @log1p(double)
    446 declare double @log1p(double)
    447 
    448 ; CHECK: declare float @log1pf(float)
    449 declare float @log1pf(float)
    450 
    451 ; CHECK: declare x86_fp80 @log1pl(x86_fp80)
    452 declare x86_fp80 @log1pl(x86_fp80)
    453 
    454 ; CHECK: declare double @log2(double)
    455 declare double @log2(double)
    456 
    457 ; CHECK: declare float @log2f(float)
    458 declare float @log2f(float)
    459 
    460 ; CHECK: declare x86_fp80 @log2l(x86_fp80)
    461 declare x86_fp80 @log2l(x86_fp80)
    462 
    463 ; CHECK: declare double @logb(double)
    464 declare double @logb(double)
    465 
    466 ; CHECK: declare float @logbf(float)
    467 declare float @logbf(float)
    468 
    469 ; CHECK: declare x86_fp80 @logbl(x86_fp80)
    470 declare x86_fp80 @logbl(x86_fp80)
    471 
    472 ; CHECK: declare float @logf(float)
    473 declare float @logf(float)
    474 
    475 ; CHECK: declare x86_fp80 @logl(x86_fp80)
    476 declare x86_fp80 @logl(x86_fp80)
    477 
    478 ; CHECK: declare i32 @lstat(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    479 declare i32 @lstat(i8*, %opaque*)
    480 
    481 ; CHECK-LINUX: declare i32 @lstat64(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    482 declare i32 @lstat64(i8*, %opaque*)
    483 
    484 ; CHECK: declare noalias i8* @malloc(i64) [[G0]]
    485 declare i8* @malloc(i64)
    486 
    487 ; CHECK-LINUX: declare noalias i8* @memalign(i64, i64)
    488 declare i8* @memalign(i64, i64)
    489 
    490 ; CHECK: declare i8* @memccpy(i8*, i8* nocapture readonly, i32, i64) [[G0]]
    491 declare i8* @memccpy(i8*, i8*, i32, i64)
    492 
    493 ; CHECK: declare i8* @memchr(i8*, i32, i64) [[G1]]
    494 declare i8* @memchr(i8*, i32, i64)
    495 
    496 ; CHECK: declare i32 @memcmp(i8* nocapture, i8* nocapture, i64) [[G1]]
    497 declare i32 @memcmp(i8*, i8*, i64)
    498 
    499 ; CHECK: declare i8* @memcpy(i8*, i8* nocapture readonly, i64) [[G0]]
    500 declare i8* @memcpy(i8*, i8*, i64)
    501 
    502 ; CHECK: declare i8* @memmove(i8*, i8* nocapture readonly, i64) [[G0]]
    503 declare i8* @memmove(i8*, i8*, i64)
    504 
    505 ; CHECK: declare i8* @memset(i8*, i32, i64)
    506 declare i8* @memset(i8*, i32, i64)
    507 
    508 ; CHECK: declare i32 @mkdir(i8* nocapture readonly, i16 zeroext) [[G0]]
    509 declare i32 @mkdir(i8*, i16 zeroext)
    510 
    511 ; CHECK: declare i64 @mktime(%opaque* nocapture) [[G0]]
    512 declare i64 @mktime(%opaque*)
    513 
    514 ; CHECK: declare double @modf(double, double* nocapture) [[G0]]
    515 declare double @modf(double, double*)
    516 
    517 ; CHECK: declare float @modff(float, float* nocapture) [[G0]]
    518 declare float @modff(float, float*)
    519 
    520 ; CHECK: declare x86_fp80 @modfl(x86_fp80, x86_fp80* nocapture) [[G0]]
    521 declare x86_fp80 @modfl(x86_fp80, x86_fp80*)
    522 
    523 ; CHECK: declare double @nearbyint(double)
    524 declare double @nearbyint(double)
    525 
    526 ; CHECK: declare float @nearbyintf(float)
    527 declare float @nearbyintf(float)
    528 
    529 ; CHECK: declare x86_fp80 @nearbyintl(x86_fp80)
    530 declare x86_fp80 @nearbyintl(x86_fp80)
    531 
    532 ; CHECK: declare i32 @open(i8* nocapture readonly, i32, ...)
    533 declare i32 @open(i8*, i32, ...)
    534 
    535 ; CHECK-LINUX: declare i32 @open64(i8* nocapture readonly, i32, ...)
    536 declare i32 @open64(i8*, i32, ...)
    537 
    538 ; CHECK: declare noalias %opaque* @opendir(i8* nocapture readonly) [[G0]]
    539 declare %opaque* @opendir(i8*)
    540 
    541 ; CHECK: declare i32 @pclose(%opaque* nocapture) [[G0]]
    542 declare i32 @pclose(%opaque*)
    543 
    544 ; CHECK: declare void @perror(i8* nocapture readonly) [[G0]]
    545 declare void @perror(i8*)
    546 
    547 ; CHECK: declare noalias %opaque* @popen(i8* nocapture readonly, i8* nocapture readonly) [[G0]]
    548 declare %opaque* @popen(i8*, i8*)
    549 
    550 ; CHECK: declare i32 @posix_memalign(i8**, i64, i64)
    551 declare i32 @posix_memalign(i8**, i64, i64)
    552 
    553 ; CHECK: declare double @pow(double, double)
    554 declare double @pow(double, double)
    555 
    556 ; CHECK: declare float @powf(float, float)
    557 declare float @powf(float, float)
    558 
    559 ; CHECK: declare x86_fp80 @powl(x86_fp80, x86_fp80)
    560 declare x86_fp80 @powl(x86_fp80, x86_fp80)
    561 
    562 ; CHECK: declare i64 @pread(i32, i8* nocapture, i64, i64)
    563 declare i64 @pread(i32, i8*, i64, i64)
    564 
    565 ; CHECK: declare i32 @printf(i8* nocapture readonly, ...) [[G0]]
    566 declare i32 @printf(i8*, ...)
    567 
    568 ; CHECK: declare i32 @putc(i32, %opaque* nocapture) [[G0]]
    569 declare i32 @putc(i32, %opaque*)
    570 
    571 ; CHECK: declare i32 @putchar(i32)
    572 declare i32 @putchar(i32)
    573 
    574 ; CHECK: declare i32 @puts(i8* nocapture readonly) [[G0]]
    575 declare i32 @puts(i8*)
    576 
    577 ; CHECK: declare i64 @pwrite(i32, i8* nocapture readonly, i64, i64)
    578 declare i64 @pwrite(i32, i8*, i64, i64)
    579 
    580 ; CHECK: declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)* nocapture)
    581 declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)
    582 
    583 ; CHECK: declare i64 @read(i32, i8* nocapture, i64)
    584 declare i64 @read(i32, i8*, i64)
    585 
    586 ; CHECK: declare i64 @readlink(i8* nocapture readonly, i8* nocapture, i64) [[G0]]
    587 declare i64 @readlink(i8*, i8*, i64)
    588 
    589 ; CHECK: declare noalias i8* @realloc(i8* nocapture, i64) [[G0]]
    590 declare i8* @realloc(i8*, i64)
    591 
    592 ; CHECK: declare i8* @reallocf(i8*, i64)
    593 declare i8* @reallocf(i8*, i64)
    594 
    595 ; CHECK: declare i8* @realpath(i8* nocapture readonly, i8*)
    596 declare i8* @realpath(i8*, i8*)
    597 
    598 ; CHECK: declare i32 @remove(i8* nocapture readonly) [[G0]]
    599 declare i32 @remove(i8*)
    600 
    601 ; CHECK: declare i32 @rename(i8* nocapture readonly, i8* nocapture readonly) [[G0]]
    602 declare i32 @rename(i8*, i8*)
    603 
    604 ; CHECK: declare void @rewind(%opaque* nocapture) [[G0]]
    605 declare void @rewind(%opaque*)
    606 
    607 ; CHECK: declare double @rint(double)
    608 declare double @rint(double)
    609 
    610 ; CHECK: declare float @rintf(float)
    611 declare float @rintf(float)
    612 
    613 ; CHECK: declare x86_fp80 @rintl(x86_fp80)
    614 declare x86_fp80 @rintl(x86_fp80)
    615 
    616 ; CHECK: declare i32 @rmdir(i8* nocapture readonly) [[G0]]
    617 declare i32 @rmdir(i8*)
    618 
    619 ; CHECK: declare double @round(double)
    620 declare double @round(double)
    621 
    622 ; CHECK: declare float @roundf(float)
    623 declare float @roundf(float)
    624 
    625 ; CHECK: declare x86_fp80 @roundl(x86_fp80)
    626 declare x86_fp80 @roundl(x86_fp80)
    627 
    628 ; CHECK: declare i32 @scanf(i8* nocapture readonly, ...) [[G0]]
    629 declare i32 @scanf(i8*, ...)
    630 
    631 ; CHECK: declare void @setbuf(%opaque* nocapture, i8*) [[G0]]
    632 declare void @setbuf(%opaque*, i8*)
    633 
    634 ; CHECK: declare i32 @setitimer(i32, %opaque* nocapture readonly, %opaque* nocapture) [[G0]]
    635 declare i32 @setitimer(i32, %opaque*, %opaque*)
    636 
    637 ; CHECK: declare i32 @setvbuf(%opaque* nocapture, i8*, i32, i64) [[G0]]
    638 declare i32 @setvbuf(%opaque*, i8*, i32, i64)
    639 
    640 ; CHECK: declare double @sin(double)
    641 declare double @sin(double)
    642 
    643 ; CHECK: declare float @sinf(float)
    644 declare float @sinf(float)
    645 
    646 ; CHECK: declare double @sinh(double)
    647 declare double @sinh(double)
    648 
    649 ; CHECK: declare float @sinhf(float)
    650 declare float @sinhf(float)
    651 
    652 ; CHECK: declare x86_fp80 @sinhl(x86_fp80)
    653 declare x86_fp80 @sinhl(x86_fp80)
    654 
    655 ; CHECK: declare x86_fp80 @sinl(x86_fp80)
    656 declare x86_fp80 @sinl(x86_fp80)
    657 
    658 ; CHECK: declare i32 @snprintf(i8* nocapture, i64, i8* nocapture readonly, ...) [[G0]]
    659 declare i32 @snprintf(i8*, i64, i8*, ...)
    660 
    661 ; CHECK: declare i32 @sprintf(i8* nocapture, i8* nocapture readonly, ...) [[G0]]
    662 declare i32 @sprintf(i8*, i8*, ...)
    663 
    664 ; CHECK: declare double @sqrt(double)
    665 declare double @sqrt(double)
    666 
    667 ; CHECK: declare float @sqrtf(float)
    668 declare float @sqrtf(float)
    669 
    670 ; CHECK: declare x86_fp80 @sqrtl(x86_fp80)
    671 declare x86_fp80 @sqrtl(x86_fp80)
    672 
    673 ; CHECK: declare i32 @sscanf(i8* nocapture readonly, i8* nocapture readonly, ...) [[G0]]
    674 declare i32 @sscanf(i8*, i8*, ...)
    675 
    676 ; CHECK: declare i32 @stat(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    677 declare i32 @stat(i8*, %opaque*)
    678 
    679 ; CHECK-LINUX: declare i32 @stat64(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    680 declare i32 @stat64(i8*, %opaque*)
    681 
    682 ; CHECK: declare i32 @statvfs(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    683 declare i32 @statvfs(i8*, %opaque*)
    684 
    685 ; CHECK-LINUX: declare i32 @statvfs64(i8* nocapture readonly, %opaque* nocapture) [[G0]]
    686 declare i32 @statvfs64(i8*, %opaque*)
    687 
    688 ; CHECK: declare i8* @stpcpy(i8*, i8* nocapture readonly) [[G0]]
    689 declare i8* @stpcpy(i8*, i8*)
    690 
    691 ; CHECK: declare i8* @stpncpy(i8*, i8* nocapture readonly, i64) [[G0]]
    692 declare i8* @stpncpy(i8*, i8*, i64)
    693 
    694 ; CHECK: declare i32 @strcasecmp(i8* nocapture, i8* nocapture) [[G1]]
    695 declare i32 @strcasecmp(i8*, i8*)
    696 
    697 ; CHECK: declare i8* @strcat(i8*, i8* nocapture readonly) [[G0]]
    698 declare i8* @strcat(i8*, i8*)
    699 
    700 ; CHECK: declare i8* @strchr(i8*, i32) [[G1]]
    701 declare i8* @strchr(i8*, i32)
    702 
    703 ; CHECK: declare i32 @strcmp(i8* nocapture, i8* nocapture) [[G1]]
    704 declare i32 @strcmp(i8*, i8*)
    705 
    706 ; CHECK: declare i32 @strcoll(i8* nocapture, i8* nocapture) [[G1]]
    707 declare i32 @strcoll(i8*, i8*)
    708 
    709 ; CHECK: declare i8* @strcpy(i8*, i8* nocapture readonly) [[G0]]
    710 declare i8* @strcpy(i8*, i8*)
    711 
    712 ; CHECK: declare i64 @strcspn(i8* nocapture, i8* nocapture) [[G1]]
    713 declare i64 @strcspn(i8*, i8*)
    714 
    715 ; CHECK: declare noalias i8* @strdup(i8* nocapture readonly) [[G0]]
    716 declare i8* @strdup(i8*)
    717 
    718 ; CHECK: declare i64 @strlen(i8* nocapture) [[G1]]
    719 declare i64 @strlen(i8*)
    720 
    721 ; CHECK: declare i32 @strncasecmp(i8* nocapture, i8* nocapture, i64) [[G1]]
    722 declare i32 @strncasecmp(i8*, i8*, i64)
    723 
    724 ; CHECK: declare i8* @strncat(i8*, i8* nocapture readonly, i64) [[G0]]
    725 declare i8* @strncat(i8*, i8*, i64)
    726 
    727 ; CHECK: declare i32 @strncmp(i8* nocapture, i8* nocapture, i64) [[G1]]
    728 declare i32 @strncmp(i8*, i8*, i64)
    729 
    730 ; CHECK: declare i8* @strncpy(i8*, i8* nocapture readonly, i64) [[G0]]
    731 declare i8* @strncpy(i8*, i8*, i64)
    732 
    733 ; CHECK: declare noalias i8* @strndup(i8* nocapture readonly, i64) [[G0]]
    734 declare i8* @strndup(i8*, i64)
    735 
    736 ; CHECK: declare i64 @strnlen(i8*, i64)
    737 declare i64 @strnlen(i8*, i64)
    738 
    739 ; CHECK: declare i8* @strpbrk(i8*, i8* nocapture) [[G1]]
    740 declare i8* @strpbrk(i8*, i8*)
    741 
    742 ; CHECK: declare i8* @strrchr(i8*, i32) [[G1]]
    743 declare i8* @strrchr(i8*, i32)
    744 
    745 ; CHECK: declare i64 @strspn(i8* nocapture, i8* nocapture) [[G1]]
    746 declare i64 @strspn(i8*, i8*)
    747 
    748 ; CHECK: declare i8* @strstr(i8*, i8* nocapture) [[G1]]
    749 declare i8* @strstr(i8*, i8*)
    750 
    751 ; CHECK: declare double @strtod(i8* readonly, i8** nocapture) [[G0]]
    752 declare double @strtod(i8*, i8**)
    753 
    754 ; CHECK: declare float @strtof(i8* readonly, i8** nocapture) [[G0]]
    755 declare float @strtof(i8*, i8**)
    756 
    757 ; CHECK: declare i8* @strtok(i8*, i8* nocapture readonly) [[G0]]
    758 declare i8* @strtok(i8*, i8*)
    759 
    760 ; CHECK: declare i8* @strtok_r(i8*, i8* nocapture readonly, i8**) [[G0]]
    761 declare i8* @strtok_r(i8*, i8*, i8**)
    762 
    763 ; CHECK: declare i64 @strtol(i8* readonly, i8** nocapture, i32) [[G0]]
    764 declare i64 @strtol(i8*, i8**, i32)
    765 
    766 ; CHECK: declare x86_fp80 @strtold(i8* readonly, i8** nocapture) [[G0]]
    767 declare x86_fp80 @strtold(i8*, i8**)
    768 
    769 ; CHECK: declare i64 @strtoll(i8* readonly, i8** nocapture, i32) [[G0]]
    770 declare i64 @strtoll(i8*, i8**, i32)
    771 
    772 ; CHECK: declare i64 @strtoul(i8* readonly, i8** nocapture, i32) [[G0]]
    773 declare i64 @strtoul(i8*, i8**, i32)
    774 
    775 ; CHECK: declare i64 @strtoull(i8* readonly, i8** nocapture, i32) [[G0]]
    776 declare i64 @strtoull(i8*, i8**, i32)
    777 
    778 ; CHECK: declare i64 @strxfrm(i8* nocapture, i8* nocapture readonly, i64) [[G0]]
    779 declare i64 @strxfrm(i8*, i8*, i64)
    780 
    781 ; CHECK: declare i32 @system(i8* nocapture readonly)
    782 declare i32 @system(i8*)
    783 
    784 ; CHECK: declare double @tan(double)
    785 declare double @tan(double)
    786 
    787 ; CHECK: declare float @tanf(float)
    788 declare float @tanf(float)
    789 
    790 ; CHECK: declare double @tanh(double)
    791 declare double @tanh(double)
    792 
    793 ; CHECK: declare float @tanhf(float)
    794 declare float @tanhf(float)
    795 
    796 ; CHECK: declare x86_fp80 @tanhl(x86_fp80)
    797 declare x86_fp80 @tanhl(x86_fp80)
    798 
    799 ; CHECK: declare x86_fp80 @tanl(x86_fp80)
    800 declare x86_fp80 @tanl(x86_fp80)
    801 
    802 ; CHECK: declare i64 @times(%opaque* nocapture) [[G0]]
    803 declare i64 @times(%opaque*)
    804 
    805 ; CHECK: declare noalias %opaque* @tmpfile() [[G0]]
    806 declare %opaque* @tmpfile()
    807 
    808 ; CHECK-LINUX: declare noalias %opaque* @tmpfile64() [[G0]]
    809 declare %opaque* @tmpfile64()
    810 
    811 ; CHECK: declare i32 @toascii(i32)
    812 declare i32 @toascii(i32)
    813 
    814 ; CHECK: declare double @trunc(double)
    815 declare double @trunc(double)
    816 
    817 ; CHECK: declare float @truncf(float)
    818 declare float @truncf(float)
    819 
    820 ; CHECK: declare x86_fp80 @truncl(x86_fp80)
    821 declare x86_fp80 @truncl(x86_fp80)
    822 
    823 ; CHECK: declare i32 @uname(%opaque* nocapture) [[G0]]
    824 declare i32 @uname(%opaque*)
    825 
    826 ; CHECK: declare i32 @ungetc(i32, %opaque* nocapture) [[G0]]
    827 declare i32 @ungetc(i32, %opaque*)
    828 
    829 ; CHECK: declare i32 @unlink(i8* nocapture readonly) [[G0]]
    830 declare i32 @unlink(i8*)
    831 
    832 ; CHECK: declare i32 @unsetenv(i8* nocapture readonly) [[G0]]
    833 declare i32 @unsetenv(i8*)
    834 
    835 ; CHECK: declare i32 @utime(i8* nocapture readonly, %opaque* nocapture readonly) [[G0]]
    836 declare i32 @utime(i8*, %opaque*)
    837 
    838 ; CHECK: declare i32 @utimes(i8* nocapture readonly, %opaque* nocapture readonly) [[G0]]
    839 declare i32 @utimes(i8*, %opaque*)
    840 
    841 ; CHECK: declare noalias i8* @valloc(i64) [[G0]]
    842 declare i8* @valloc(i64)
    843 
    844 ; CHECK: declare i32 @vfprintf(%opaque* nocapture, i8* nocapture readonly, %opaque*) [[G0]]
    845 declare i32 @vfprintf(%opaque*, i8*, %opaque*)
    846 
    847 ; CHECK: declare i32 @vfscanf(%opaque* nocapture, i8* nocapture readonly, %opaque*) [[G0]]
    848 declare i32 @vfscanf(%opaque*, i8*, %opaque*)
    849 
    850 ; CHECK: declare i32 @vprintf(i8* nocapture readonly, %opaque*) [[G0]]
    851 declare i32 @vprintf(i8*, %opaque*)
    852 
    853 ; CHECK: declare i32 @vscanf(i8* nocapture readonly, %opaque*) [[G0]]
    854 declare i32 @vscanf(i8*, %opaque*)
    855 
    856 ; CHECK: declare i32 @vsnprintf(i8* nocapture, i64, i8* nocapture readonly, %opaque*) [[G0]]
    857 declare i32 @vsnprintf(i8*, i64, i8*, %opaque*)
    858 
    859 ; CHECK: declare i32 @vsprintf(i8* nocapture, i8* nocapture readonly, %opaque*) [[G0]]
    860 declare i32 @vsprintf(i8*, i8*, %opaque*)
    861 
    862 ; CHECK: declare i32 @vsscanf(i8* nocapture readonly, i8* nocapture readonly, %opaque*) [[G0]]
    863 declare i32 @vsscanf(i8*, i8*, %opaque*)
    864 
    865 ; CHECK: declare i64 @write(i32, i8* nocapture readonly, i64)
    866 declare i64 @write(i32, i8*, i64)
    867 
    868 
    869 ; memset_pattern16 isn't available everywhere.
    870 ; CHECK-DARWIN: declare void @memset_pattern16(i8* nocapture, i8* nocapture readonly, i64) [[G2:#[0-9]+]]
    871 declare void @memset_pattern16(i8*, i8*, i64)
    872 
    873 
    874 ; CHECK: attributes [[G0]] = { nounwind }
    875 ; CHECK: attributes [[G1]] = { nounwind readonly }
    876 ; CHECK-DARWIN: attributes [[G2]] = { argmemonly }
    877