[llvm] r270750 - [TLI] Fix NumParams==0 prototype checking typo.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 13:23:16 PDT 2016


Author: ab
Date: Wed May 25 15:22:45 2016
New Revision: 270750

URL: http://llvm.org/viewvc/llvm-project?rev=270750&view=rev
Log:
[TLI] Fix NumParams==0 prototype checking typo.

There was a typo in r267758. It caused invalid accesses when
given something like "void @free(...)", as NumParams == 0, and
we then try to look at the 0th parameter.

Turns out, most of these were untested; add both attribute
and missing-prototype checks for all libc libfuncs.

Differential Revision: http://reviews.llvm.org/D20543

Added:
    llvm/trunk/test/Transforms/InferFunctionAttrs/no-proto.ll
Modified:
    llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
    llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll

Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=270750&r1=270749&r2=270750&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Wed May 25 15:22:45 2016
@@ -662,10 +662,6 @@ bool TargetLibraryInfoImpl::isValidProto
     return (NumParams >= 2 && FTy.getParamType(1)->isPointerTy());
   case LibFunc::memalign:
     return (FTy.getReturnType()->isPointerTy());
-  case LibFunc::mkdir:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
-  case LibFunc::mktime:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::realloc:
     return (NumParams == 2 && FTy.getParamType(0)->isPointerTy() &&
             FTy.getReturnType()->isPointerTy());
@@ -695,18 +691,53 @@ bool TargetLibraryInfoImpl::isValidProto
     return (NumParams == 2 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::calloc:
     return (NumParams == 2 && FTy.getReturnType()->isPointerTy());
-  case LibFunc::chmod:
-  case LibFunc::chown:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
-  case LibFunc::ctermid:
-  case LibFunc::clearerr:
-  case LibFunc::closedir:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
+
+  case LibFunc::atof:
   case LibFunc::atoi:
   case LibFunc::atol:
-  case LibFunc::atof:
   case LibFunc::atoll:
+  case LibFunc::ferror:
+  case LibFunc::fseeko64:
+  case LibFunc::ftello64:
+  case LibFunc::getenv:
+  case LibFunc::getpwnam:
+  case LibFunc::pclose:
+  case LibFunc::perror:
+  case LibFunc::printf:
+  case LibFunc::puts:
+  case LibFunc::uname:
+  case LibFunc::under_IO_getc:
+  case LibFunc::unlink:
+  case LibFunc::unsetenv:
     return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
+
+  case LibFunc::chmod:
+  case LibFunc::chown:
+  case LibFunc::clearerr:
+  case LibFunc::closedir:
+  case LibFunc::ctermid:
+  case LibFunc::fclose:
+  case LibFunc::feof:
+  case LibFunc::fflush:
+  case LibFunc::fgetc:
+  case LibFunc::fileno:
+  case LibFunc::flockfile:
+  case LibFunc::free:
+  case LibFunc::fseek:
+  case LibFunc::fseeko:
+  case LibFunc::fsetpos:
+  case LibFunc::ftell:
+  case LibFunc::ftello:
+  case LibFunc::ftrylockfile:
+  case LibFunc::funlockfile:
+  case LibFunc::getc:
+  case LibFunc::getc_unlocked:
+  case LibFunc::getlogin_r:
+  case LibFunc::mkdir:
+  case LibFunc::mktime:
+  case LibFunc::times:
+    return (NumParams != 0 && FTy.getParamType(0)->isPointerTy());
+
   case LibFunc::access:
     return (NumParams == 2 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::fopen:
@@ -716,23 +747,6 @@ bool TargetLibraryInfoImpl::isValidProto
   case LibFunc::fdopen:
     return (NumParams == 2 && FTy.getReturnType()->isPointerTy() &&
             FTy.getParamType(1)->isPointerTy());
-  case LibFunc::feof:
-  case LibFunc::free:
-  case LibFunc::fseek:
-  case LibFunc::ftell:
-  case LibFunc::fgetc:
-  case LibFunc::fseeko:
-  case LibFunc::ftello:
-  case LibFunc::fileno:
-  case LibFunc::fflush:
-  case LibFunc::fclose:
-  case LibFunc::fsetpos:
-  case LibFunc::flockfile:
-  case LibFunc::funlockfile:
-  case LibFunc::ftrylockfile:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
-  case LibFunc::ferror:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::fputc:
   case LibFunc::fstat:
   case LibFunc::frexp:
@@ -762,46 +776,25 @@ bool TargetLibraryInfoImpl::isValidProto
   case LibFunc::fgetpos:
     return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() &&
             FTy.getParamType(1)->isPointerTy());
-  case LibFunc::getc:
-  case LibFunc::getlogin_r:
-  case LibFunc::getc_unlocked:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
-  case LibFunc::getenv:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::gets:
   case LibFunc::getchar:
   case LibFunc::getitimer:
     return (NumParams == 2 && FTy.getParamType(1)->isPointerTy());
-  case LibFunc::getpwnam:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::ungetc:
     return (NumParams == 2 && FTy.getParamType(1)->isPointerTy());
-  case LibFunc::uname:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
-  case LibFunc::unlink:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
-  case LibFunc::unsetenv:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::utime:
   case LibFunc::utimes:
     return (NumParams == 2 && FTy.getParamType(0)->isPointerTy() &&
             FTy.getParamType(1)->isPointerTy());
   case LibFunc::putc:
     return (NumParams == 2 && FTy.getParamType(1)->isPointerTy());
-  case LibFunc::puts:
-  case LibFunc::printf:
-  case LibFunc::perror:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::pread:
   case LibFunc::pwrite:
     return (NumParams == 4 && FTy.getParamType(1)->isPointerTy());
-  case LibFunc::putchar:
   case LibFunc::popen:
     return (NumParams == 2 && FTy.getReturnType()->isPointerTy() &&
             FTy.getParamType(0)->isPointerTy() &&
             FTy.getParamType(1)->isPointerTy());
-  case LibFunc::pclose:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::vscanf:
     return (NumParams == 2 && FTy.getParamType(1)->isPointerTy());
   case LibFunc::vsscanf:
@@ -828,8 +821,6 @@ bool TargetLibraryInfoImpl::isValidProto
             FTy.getParamType(0)->isPointerTy());
   case LibFunc::tmpfile:
     return (FTy.getReturnType()->isPointerTy());
-  case LibFunc::times:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::htonl:
   case LibFunc::htons:
   case LibFunc::ntohl:
@@ -847,8 +838,6 @@ bool TargetLibraryInfoImpl::isValidProto
             FTy.getParamType(0)->isPointerTy());
   case LibFunc::dunder_strtok_r:
     return (NumParams == 3 && FTy.getParamType(1)->isPointerTy());
-  case LibFunc::under_IO_getc:
-    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::under_IO_putc:
     return (NumParams == 2 && FTy.getParamType(1)->isPointerTy());
   case LibFunc::dunder_isoc99_scanf:
@@ -865,9 +854,6 @@ bool TargetLibraryInfoImpl::isValidProto
     return (NumParams == 2 && FTy.getReturnType()->isPointerTy() &&
             FTy.getParamType(0)->isPointerTy() &&
             FTy.getParamType(1)->isPointerTy());
-  case LibFunc::fseeko64:
-  case LibFunc::ftello64:
-    return (NumParams == 0 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::tmpfile64:
     return (FTy.getReturnType()->isPointerTy());
   case LibFunc::fstat64:

Modified: llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll?rev=270750&r1=270749&r2=270750&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll (original)
+++ llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll Wed May 25 15:22:45 2016
@@ -1,40 +1,845 @@
-; RUN: opt < %s -inferattrs -S | FileCheck %s
-; RUN: opt < %s -passes=inferattrs -S | FileCheck %s
-; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck -check-prefix=CHECK-POSIX %s
+; RUN: opt < %s -mtriple=x86_64-- -inferattrs -S | FileCheck %s
+; RUN: opt < %s -mtriple=x86_64-- -passes=inferattrs -S | FileCheck %s
+; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck -check-prefix=CHECK-DARWIN %s
 ; RUN: opt < %s -mtriple=nvptx -inferattrs -S | FileCheck -check-prefix=CHECK-NVPTX %s
 
-declare i8* @fopen(i8*, i8*)
-; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0:#[0-9]]] 
-
-declare i8 @strlen(i8*)
-; CHECK: declare i8 @strlen(i8* nocapture) [[G1:#[0-9]]]
-
-declare i32* @realloc(i32*, i32)
-; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) [[G0]]
-
-; Test deliberately wrong declaration
-
-declare i32 @strcpy(...)
-; CHECK: declare i32 @strcpy(...)
-
 ; operator new routines
 declare i8* @_Znwj(i64)
 ; CHECK: declare noalias nonnull i8* @_Znwj(i64)
 declare i8* @_Znwm(i64)
 ; CHECK: declare noalias nonnull i8* @_Znwm(i64)
 
+declare i32 @__nvvm_reflect(i8*)
+; CHECK-NVPTX: declare i32 @__nvvm_reflect(i8*) [[G0:#[0-9]+]]
+; CHECK-NVPTX: attributes [[G0]] = { nounwind readnone }
+
+
+; Check all the libc functions (thereby also exercising the prototype check).
+; Note that it's OK to modify these as attributes might be missing. These checks
+; reflect the currently inferred attributes.
+
+; Use an opaque pointer type for all the (possibly opaque) structs.
+%opaque = type opaque
+
+; CHECK: declare double @__cospi(double)
+declare double @__cospi(double)
+
+; CHECK: declare float @__cospif(float)
+declare float @__cospif(float)
+
+; CHECK: declare double @__sinpi(double)
+declare double @__sinpi(double)
+
+; CHECK: declare float @__sinpif(float)
+declare float @__sinpif(float)
+
+; CHECK: declare i32 @abs(i32)
+declare i32 @abs(i32)
+
+; CHECK: declare i32 @access(i8* nocapture readonly, i32) [[G0:#[0-9]+]]
+declare i32 @access(i8*, i32)
+
+; CHECK: declare double @acos(double)
+declare double @acos(double)
+
+; CHECK: declare float @acosf(float)
+declare float @acosf(float)
+
+; CHECK: declare double @acosh(double)
+declare double @acosh(double)
+
+; CHECK: declare float @acoshf(float)
+declare float @acoshf(float)
+
+; CHECK: declare x86_fp80 @acoshl(x86_fp80)
+declare x86_fp80 @acoshl(x86_fp80)
+
+; CHECK: declare x86_fp80 @acosl(x86_fp80)
+declare x86_fp80 @acosl(x86_fp80)
+
+; CHECK: declare double @asin(double)
+declare double @asin(double)
+
+; CHECK: declare float @asinf(float)
+declare float @asinf(float)
+
+; CHECK: declare double @asinh(double)
+declare double @asinh(double)
+
+; CHECK: declare float @asinhf(float)
+declare float @asinhf(float)
+
+; CHECK: declare x86_fp80 @asinhl(x86_fp80)
+declare x86_fp80 @asinhl(x86_fp80)
+
+; CHECK: declare x86_fp80 @asinl(x86_fp80)
+declare x86_fp80 @asinl(x86_fp80)
+
+; CHECK: declare double @atan(double)
+declare double @atan(double)
+
+; CHECK: declare double @atan2(double, double)
+declare double @atan2(double, double)
+
+; CHECK: declare float @atan2f(float, float)
+declare float @atan2f(float, float)
+
+; CHECK: declare x86_fp80 @atan2l(x86_fp80, x86_fp80)
+declare x86_fp80 @atan2l(x86_fp80, x86_fp80)
+
+; CHECK: declare float @atanf(float)
+declare float @atanf(float)
+
+; CHECK: declare double @atanh(double)
+declare double @atanh(double)
+
+; CHECK: declare float @atanhf(float)
+declare float @atanhf(float)
+
+; CHECK: declare x86_fp80 @atanhl(x86_fp80)
+declare x86_fp80 @atanhl(x86_fp80)
+
+; CHECK: declare x86_fp80 @atanl(x86_fp80)
+declare x86_fp80 @atanl(x86_fp80)
+
+; CHECK: declare double @atof(i8* nocapture) [[G1:#[0-9]+]]
+declare double @atof(i8*)
+
+; CHECK: declare i32 @atoi(i8* nocapture) [[G1]]
+declare i32 @atoi(i8*)
+
+; CHECK: declare i64 @atol(i8* nocapture) [[G1]]
+declare i64 @atol(i8*)
+
+; CHECK: declare i64 @atoll(i8* nocapture) [[G1]]
+declare i64 @atoll(i8*)
+
+; CHECK: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[G1]]
+declare i32 @bcmp(i8*, i8*, i64)
+
+; CHECK: declare void @bcopy(i8* nocapture readonly, i8* nocapture, i64) [[G0]]
+declare void @bcopy(i8*, i8*, i64)
+
+; CHECK: declare void @bzero(i8* nocapture, i64) [[G0]]
+declare void @bzero(i8*, i64)
+
+; CHECK: declare noalias i8* @calloc(i64, i64) [[G0]]
+declare i8* @calloc(i64, i64)
+
+; CHECK: declare double @cbrt(double)
+declare double @cbrt(double)
+
+; CHECK: declare float @cbrtf(float)
+declare float @cbrtf(float)
+
+; CHECK: declare x86_fp80 @cbrtl(x86_fp80)
+declare x86_fp80 @cbrtl(x86_fp80)
+
+; CHECK: declare double @ceil(double)
+declare double @ceil(double)
+
+; CHECK: declare float @ceilf(float)
+declare float @ceilf(float)
+
+; CHECK: declare x86_fp80 @ceill(x86_fp80)
+declare x86_fp80 @ceill(x86_fp80)
+
+; CHECK: declare i32 @chmod(i8* nocapture readonly, i16 zeroext) [[G0]]
+declare i32 @chmod(i8*, i16 zeroext)
+
+; CHECK: declare i32 @chown(i8* nocapture readonly, i32, i32) [[G0]]
+declare i32 @chown(i8*, i32, i32)
+
+; CHECK: declare void @clearerr(%opaque* nocapture) [[G0]]
+declare void @clearerr(%opaque*)
+
+; CHECK: declare i32 @closedir(%opaque* nocapture) [[G0]]
+declare i32 @closedir(%opaque*)
+
+; CHECK: declare double @copysign(double, double)
+declare double @copysign(double, double)
+
+; CHECK: declare float @copysignf(float, float)
+declare float @copysignf(float, float)
+
+; CHECK: declare x86_fp80 @copysignl(x86_fp80, x86_fp80)
+declare x86_fp80 @copysignl(x86_fp80, x86_fp80)
+
+; CHECK: declare double @cos(double)
+declare double @cos(double)
+
+; CHECK: declare float @cosf(float)
+declare float @cosf(float)
+
+; CHECK: declare double @cosh(double)
+declare double @cosh(double)
+
+; CHECK: declare float @coshf(float)
+declare float @coshf(float)
+
+; CHECK: declare x86_fp80 @coshl(x86_fp80)
+declare x86_fp80 @coshl(x86_fp80)
+
+; CHECK: declare x86_fp80 @cosl(x86_fp80)
+declare x86_fp80 @cosl(x86_fp80)
+
+; CHECK: declare i8* @ctermid(i8* nocapture) [[G0]]
+declare i8* @ctermid(i8*)
+
+; CHECK: declare double @exp(double)
+declare double @exp(double)
+
+; CHECK: declare double @exp2(double)
+declare double @exp2(double)
+
+; CHECK: declare float @exp2f(float)
+declare float @exp2f(float)
+
+; CHECK: declare x86_fp80 @exp2l(x86_fp80)
+declare x86_fp80 @exp2l(x86_fp80)
+
+; CHECK: declare float @expf(float)
+declare float @expf(float)
+
+; CHECK: declare x86_fp80 @expl(x86_fp80)
+declare x86_fp80 @expl(x86_fp80)
+
+; CHECK: declare double @expm1(double)
+declare double @expm1(double)
+
+; CHECK: declare float @expm1f(float)
+declare float @expm1f(float)
+
+; CHECK: declare x86_fp80 @expm1l(x86_fp80)
+declare x86_fp80 @expm1l(x86_fp80)
+
+; CHECK: declare double @fabs(double)
+declare double @fabs(double)
+
+; CHECK: declare float @fabsf(float)
+declare float @fabsf(float)
+
+; CHECK: declare x86_fp80 @fabsl(x86_fp80)
+declare x86_fp80 @fabsl(x86_fp80)
+
+; CHECK: declare i32 @fclose(%opaque* nocapture) [[G0]]
+declare i32 @fclose(%opaque*)
+
+; CHECK: declare noalias %opaque* @fdopen(i32, i8* nocapture readonly) [[G0]]
+declare %opaque* @fdopen(i32, i8*)
+
+; CHECK: declare i32 @feof(%opaque* nocapture) [[G0]]
+declare i32 @feof(%opaque*)
+
+; CHECK: declare i32 @ferror(%opaque* nocapture) [[G1]]
+declare i32 @ferror(%opaque*)
+
+; CHECK: declare i32 @fflush(%opaque* nocapture) [[G0]]
+declare i32 @fflush(%opaque*)
+
+; CHECK: declare i32 @ffs(i32)
+declare i32 @ffs(i32)
+
+; CHECK: declare i32 @ffsl(i64)
+declare i32 @ffsl(i64)
+
+; CHECK: declare i32 @ffsll(i64)
+declare i32 @ffsll(i64)
+
+; CHECK: declare i32 @fgetc(%opaque* nocapture) [[G0]]
+declare i32 @fgetc(%opaque*)
+
+; CHECK: declare i32 @fgetpos(%opaque* nocapture, i64* nocapture) [[G0]]
+declare i32 @fgetpos(%opaque*, i64*)
+
+; CHECK: declare i8* @fgets(i8*, i32, %opaque* nocapture) [[G0]]
+declare i8* @fgets(i8*, i32, %opaque*)
+
+; CHECK: declare i32 @fileno(%opaque* nocapture) [[G0]]
+declare i32 @fileno(%opaque*)
+
+; CHECK: declare void @flockfile(%opaque* nocapture) [[G0]]
+declare void @flockfile(%opaque*)
+
+; CHECK: declare double @floor(double)
+declare double @floor(double)
+
+; CHECK: declare float @floorf(float)
+declare float @floorf(float)
+
+; CHECK: declare x86_fp80 @floorl(x86_fp80)
+declare x86_fp80 @floorl(x86_fp80)
+
+; CHECK: declare i32 @fls(i32)
+declare i32 @fls(i32)
+
+; CHECK: declare i32 @flsl(i64)
+declare i32 @flsl(i64)
+
+; CHECK: declare i32 @flsll(i64)
+declare i32 @flsll(i64)
+
+; CHECK: declare double @fmax(double, double)
+declare double @fmax(double, double)
+
+; CHECK: declare float @fmaxf(float, float)
+declare float @fmaxf(float, float)
+
+; CHECK: declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)
+declare x86_fp80 @fmaxl(x86_fp80, x86_fp80)
+
+; CHECK: declare double @fmin(double, double)
+declare double @fmin(double, double)
+
+; CHECK: declare float @fminf(float, float)
+declare float @fminf(float, float)
+
+; CHECK: declare x86_fp80 @fminl(x86_fp80, x86_fp80)
+declare x86_fp80 @fminl(x86_fp80, x86_fp80)
+
+; CHECK: declare double @fmod(double, double)
+declare double @fmod(double, double)
+
+; CHECK: declare float @fmodf(float, float)
+declare float @fmodf(float, float)
+
+; CHECK: declare x86_fp80 @fmodl(x86_fp80, x86_fp80)
+declare x86_fp80 @fmodl(x86_fp80, x86_fp80)
+
+; CHECK: declare noalias %opaque* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0]]
+declare %opaque* @fopen(i8*, i8*)
+
+; CHECK: declare i32 @fprintf(%opaque* nocapture, i8* nocapture readonly, ...) [[G0]]
+declare i32 @fprintf(%opaque*, i8*, ...)
+
+; CHECK: declare i32 @fputc(i32, %opaque* nocapture) [[G0]]
+declare i32 @fputc(i32, %opaque*)
+
+; CHECK: declare i32 @fputs(i8* nocapture readonly, %opaque* nocapture) [[G0]]
+declare i32 @fputs(i8*, %opaque*)
+
+; CHECK: declare i64 @fread(i8* nocapture, i64, i64, %opaque* nocapture) [[G0]]
+declare i64 @fread(i8*, i64, i64, %opaque*)
+
+; CHECK: declare void @free(i8* nocapture) [[G0]]
+declare void @free(i8*)
+
+; CHECK: declare double @frexp(double, i32* nocapture) [[G0]]
+declare double @frexp(double, i32*)
+
+; CHECK: declare float @frexpf(float, i32* nocapture) [[G0]]
+declare float @frexpf(float, i32*)
+
+; CHECK: declare x86_fp80 @frexpl(x86_fp80, i32* nocapture) [[G0]]
+declare x86_fp80 @frexpl(x86_fp80, i32*)
+
+; CHECK: declare i32 @fscanf(%opaque* nocapture, i8* nocapture readonly, ...) [[G0]]
+declare i32 @fscanf(%opaque*, i8*, ...)
+
+; CHECK: declare i32 @fseek(%opaque* nocapture, i64, i32) [[G0]]
+declare i32 @fseek(%opaque*, i64, i32)
+
+; CHECK: declare i32 @fseeko(%opaque* nocapture, i64, i32) [[G0]]
+declare i32 @fseeko(%opaque*, i64, i32)
+
+; CHECK: declare i32 @fsetpos(%opaque* nocapture, i64*) [[G0]]
+declare i32 @fsetpos(%opaque*, i64*)
+
+; CHECK: declare i32 @fstat(i32, %opaque* nocapture) [[G0]]
+declare i32 @fstat(i32, %opaque*)
+
+; CHECK: declare i32 @fstatvfs(i32, %opaque* nocapture) [[G0]]
+declare i32 @fstatvfs(i32, %opaque*)
+
+; CHECK: declare i64 @ftell(%opaque* nocapture) [[G0]]
+declare i64 @ftell(%opaque*)
+
+; CHECK: declare i64 @ftello(%opaque* nocapture) [[G0]]
+declare i64 @ftello(%opaque*)
+
+; CHECK: declare i32 @ftrylockfile(%opaque* nocapture) [[G0]]
+declare i32 @ftrylockfile(%opaque*)
+
+; CHECK: declare void @funlockfile(%opaque* nocapture) [[G0]]
+declare void @funlockfile(%opaque*)
+
+; CHECK: declare i64 @fwrite(i8* nocapture, i64, i64, %opaque* nocapture) [[G0]]
+declare i64 @fwrite(i8*, i64, i64, %opaque*)
+
+; CHECK: declare i32 @getc(%opaque* nocapture) [[G0]]
+declare i32 @getc(%opaque*)
+
+; CHECK: declare i32 @getc_unlocked(%opaque* nocapture) [[G0]]
+declare i32 @getc_unlocked(%opaque*)
+
+; CHECK: declare i32 @getchar()
+declare i32 @getchar()
+
+; CHECK: declare i8* @getenv(i8* nocapture) [[G1]]
+declare i8* @getenv(i8*)
+
+; CHECK: declare i32 @getitimer(i32, %opaque* nocapture) [[G0]]
+declare i32 @getitimer(i32, %opaque*)
+
+; CHECK: declare i32 @getlogin_r(i8* nocapture, i64) [[G0]]
+declare i32 @getlogin_r(i8*, i64)
+
+; CHECK: declare %opaque* @getpwnam(i8* nocapture readonly) [[G0]]
+declare %opaque* @getpwnam(i8*)
+
+; CHECK: declare i8* @gets(i8*)
+declare i8* @gets(i8*)
+
+; CHECK: declare i32 @gettimeofday(%opaque* nocapture, i8* nocapture) [[G0]]
+declare i32 @gettimeofday(%opaque*, i8*)
+
+; CHECK: declare i32 @isascii(i32)
+declare i32 @isascii(i32)
+
+; CHECK: declare i32 @isdigit(i32)
+declare i32 @isdigit(i32)
+
+; CHECK: declare i64 @labs(i64)
+declare i64 @labs(i64)
+
+; CHECK: declare i32 @lchown(i8* nocapture readonly, i32, i32) [[G0]]
+declare i32 @lchown(i8*, i32, i32)
+
+; CHECK: declare double @ldexp(double, i32)
+declare double @ldexp(double, i32)
+
+; CHECK: declare float @ldexpf(float, i32)
+declare float @ldexpf(float, i32)
+
+; CHECK: declare x86_fp80 @ldexpl(x86_fp80, i32)
+declare x86_fp80 @ldexpl(x86_fp80, i32)
+
+; CHECK: declare i64 @llabs(i64)
+declare i64 @llabs(i64)
+
+; CHECK: declare double @log(double)
+declare double @log(double)
+
+; CHECK: declare double @log10(double)
+declare double @log10(double)
+
+; CHECK: declare float @log10f(float)
+declare float @log10f(float)
+
+; CHECK: declare x86_fp80 @log10l(x86_fp80)
+declare x86_fp80 @log10l(x86_fp80)
+
+; CHECK: declare double @log1p(double)
+declare double @log1p(double)
+
+; CHECK: declare float @log1pf(float)
+declare float @log1pf(float)
+
+; CHECK: declare x86_fp80 @log1pl(x86_fp80)
+declare x86_fp80 @log1pl(x86_fp80)
+
+; CHECK: declare double @log2(double)
+declare double @log2(double)
+
+; CHECK: declare float @log2f(float)
+declare float @log2f(float)
+
+; CHECK: declare x86_fp80 @log2l(x86_fp80)
+declare x86_fp80 @log2l(x86_fp80)
+
+; CHECK: declare double @logb(double)
+declare double @logb(double)
+
+; CHECK: declare float @logbf(float)
+declare float @logbf(float)
+
+; CHECK: declare x86_fp80 @logbl(x86_fp80)
+declare x86_fp80 @logbl(x86_fp80)
+
+; CHECK: declare float @logf(float)
+declare float @logf(float)
+
+; CHECK: declare x86_fp80 @logl(x86_fp80)
+declare x86_fp80 @logl(x86_fp80)
+
+; CHECK: declare i32 @lstat(i8* nocapture readonly, %opaque* nocapture) [[G0]]
+declare i32 @lstat(i8*, %opaque*)
+
+; CHECK: declare noalias i8* @malloc(i64) [[G0]]
+declare i8* @malloc(i64)
+
+; CHECK: declare i8* @memccpy(i8*, i8* nocapture readonly, i32, i64) [[G0]]
+declare i8* @memccpy(i8*, i8*, i32, i64)
+
+; CHECK: declare i8* @memchr(i8*, i32, i64) [[G1]]
+declare i8* @memchr(i8*, i32, i64)
+
+; CHECK: declare i32 @memcmp(i8* nocapture, i8* nocapture, i64) [[G1]]
+declare i32 @memcmp(i8*, i8*, i64)
+
+; CHECK: declare i8* @memcpy(i8*, i8* nocapture readonly, i64) [[G0]]
+declare i8* @memcpy(i8*, i8*, i64)
+
+; CHECK: declare i8* @memmove(i8*, i8* nocapture readonly, i64) [[G0]]
+declare i8* @memmove(i8*, i8*, i64)
+
+; CHECK: declare i8* @memset(i8*, i32, i64)
+declare i8* @memset(i8*, i32, i64)
+
+; CHECK: declare i32 @mkdir(i8* nocapture readonly, i16 zeroext) [[G0]]
+declare i32 @mkdir(i8*, i16 zeroext)
+
+; CHECK: declare i64 @mktime(%opaque* nocapture) [[G0]]
+declare i64 @mktime(%opaque*)
+
+; CHECK: declare double @modf(double, double* nocapture) [[G0]]
+declare double @modf(double, double*)
+
+; CHECK: declare float @modff(float, float* nocapture) [[G0]]
+declare float @modff(float, float*)
+
+; CHECK: declare x86_fp80 @modfl(x86_fp80, x86_fp80* nocapture) [[G0]]
+declare x86_fp80 @modfl(x86_fp80, x86_fp80*)
+
+; CHECK: declare double @nearbyint(double)
+declare double @nearbyint(double)
+
+; CHECK: declare float @nearbyintf(float)
+declare float @nearbyintf(float)
+
+; CHECK: declare x86_fp80 @nearbyintl(x86_fp80)
+declare x86_fp80 @nearbyintl(x86_fp80)
+
+; CHECK: declare i32 @open(i8* nocapture readonly, i32, ...)
+declare i32 @open(i8*, i32, ...)
+
+; CHECK: declare noalias %opaque* @opendir(i8* nocapture readonly) [[G0]]
+declare %opaque* @opendir(i8*)
+
+; CHECK: declare i32 @pclose(%opaque* nocapture) [[G0]]
+declare i32 @pclose(%opaque*)
+
+; CHECK: declare void @perror(i8* nocapture readonly) [[G0]]
+declare void @perror(i8*)
+
+; CHECK: declare noalias %opaque* @popen(i8* nocapture readonly, i8* nocapture readonly) [[G0]]
+declare %opaque* @popen(i8*, i8*)
+
+; CHECK: declare i32 @posix_memalign(i8**, i64, i64)
+declare i32 @posix_memalign(i8**, i64, i64)
+
+; CHECK: declare double @pow(double, double)
+declare double @pow(double, double)
+
+; CHECK: declare float @powf(float, float)
+declare float @powf(float, float)
+
+; CHECK: declare x86_fp80 @powl(x86_fp80, x86_fp80)
+declare x86_fp80 @powl(x86_fp80, x86_fp80)
+
+; CHECK: declare i64 @pread(i32, i8* nocapture, i64, i64)
+declare i64 @pread(i32, i8*, i64, i64)
+
+; CHECK: declare i32 @printf(i8* nocapture readonly, ...) [[G0]]
+declare i32 @printf(i8*, ...)
+
+; CHECK: declare i32 @putc(i32, %opaque* nocapture) [[G0]]
+declare i32 @putc(i32, %opaque*)
+
+; CHECK: declare i32 @putchar(i32)
+declare i32 @putchar(i32)
+
+; CHECK: declare i32 @puts(i8* nocapture readonly) [[G0]]
+declare i32 @puts(i8*)
+
+; CHECK: declare i64 @pwrite(i32, i8* nocapture readonly, i64, i64)
+declare i64 @pwrite(i32, i8*, i64, i64)
+
+; CHECK: declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)* nocapture)
+declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)
+
+; CHECK: declare i64 @read(i32, i8* nocapture, i64)
+declare i64 @read(i32, i8*, i64)
+
+; CHECK: declare i64 @readlink(i8* nocapture readonly, i8* nocapture, i64) [[G0]]
+declare i64 @readlink(i8*, i8*, i64)
+
+; CHECK: declare noalias i8* @realloc(i8* nocapture, i64) [[G0]]
+declare i8* @realloc(i8*, i64)
+
+; CHECK: declare i8* @reallocf(i8*, i64)
+declare i8* @reallocf(i8*, i64)
+
+; CHECK: declare i8* @realpath(i8* nocapture readonly, i8*)
+declare i8* @realpath(i8*, i8*)
+
+; CHECK: declare i32 @remove(i8* nocapture readonly) [[G0]]
+declare i32 @remove(i8*)
+
+; CHECK: declare i32 @rename(i8* nocapture readonly, i8* nocapture readonly) [[G0]]
+declare i32 @rename(i8*, i8*)
+
+; CHECK: declare void @rewind(%opaque* nocapture) [[G0]]
+declare void @rewind(%opaque*)
+
+; CHECK: declare double @rint(double)
+declare double @rint(double)
+
+; CHECK: declare float @rintf(float)
+declare float @rintf(float)
+
+; CHECK: declare x86_fp80 @rintl(x86_fp80)
+declare x86_fp80 @rintl(x86_fp80)
+
+; CHECK: declare i32 @rmdir(i8* nocapture readonly) [[G0]]
+declare i32 @rmdir(i8*)
+
+; CHECK: declare double @round(double)
+declare double @round(double)
+
+; CHECK: declare float @roundf(float)
+declare float @roundf(float)
+
+; CHECK: declare x86_fp80 @roundl(x86_fp80)
+declare x86_fp80 @roundl(x86_fp80)
+
+; CHECK: declare i32 @scanf(i8* nocapture readonly, ...) [[G0]]
+declare i32 @scanf(i8*, ...)
+
+; CHECK: declare void @setbuf(%opaque* nocapture, i8*) [[G0]]
+declare void @setbuf(%opaque*, i8*)
+
+; CHECK: declare i32 @setitimer(i32, %opaque* nocapture readonly, %opaque* nocapture) [[G0]]
+declare i32 @setitimer(i32, %opaque*, %opaque*)
+
+; CHECK: declare i32 @setvbuf(%opaque* nocapture, i8*, i32, i64) [[G0]]
+declare i32 @setvbuf(%opaque*, i8*, i32, i64)
+
+; CHECK: declare double @sin(double)
+declare double @sin(double)
+
+; CHECK: declare float @sinf(float)
+declare float @sinf(float)
+
+; CHECK: declare double @sinh(double)
+declare double @sinh(double)
+
+; CHECK: declare float @sinhf(float)
+declare float @sinhf(float)
+
+; CHECK: declare x86_fp80 @sinhl(x86_fp80)
+declare x86_fp80 @sinhl(x86_fp80)
+
+; CHECK: declare x86_fp80 @sinl(x86_fp80)
+declare x86_fp80 @sinl(x86_fp80)
+
+; CHECK: declare i32 @snprintf(i8* nocapture, i64, i8* nocapture readonly, ...) [[G0]]
+declare i32 @snprintf(i8*, i64, i8*, ...)
+
+; CHECK: declare i32 @sprintf(i8* nocapture, i8* nocapture readonly, ...) [[G0]]
+declare i32 @sprintf(i8*, i8*, ...)
+
+; CHECK: declare double @sqrt(double)
+declare double @sqrt(double)
+
+; CHECK: declare float @sqrtf(float)
+declare float @sqrtf(float)
+
+; CHECK: declare x86_fp80 @sqrtl(x86_fp80)
+declare x86_fp80 @sqrtl(x86_fp80)
+
+; CHECK: declare i32 @sscanf(i8* nocapture readonly, i8* nocapture readonly, ...) [[G0]]
+declare i32 @sscanf(i8*, i8*, ...)
+
+; CHECK: declare i32 @stat(i8* nocapture readonly, %opaque* nocapture) [[G0]]
+declare i32 @stat(i8*, %opaque*)
+
+; CHECK: declare i32 @statvfs(i8* nocapture readonly, %opaque* nocapture) [[G0]]
+declare i32 @statvfs(i8*, %opaque*)
+
+; CHECK: declare i8* @stpcpy(i8*, i8* nocapture readonly) [[G0]]
+declare i8* @stpcpy(i8*, i8*)
+
+; CHECK: declare i8* @stpncpy(i8*, i8* nocapture readonly, i64) [[G0]]
+declare i8* @stpncpy(i8*, i8*, i64)
+
+; CHECK: declare i32 @strcasecmp(i8* nocapture, i8* nocapture) [[G1]]
+declare i32 @strcasecmp(i8*, i8*)
+
+; CHECK: declare i8* @strcat(i8*, i8* nocapture readonly) [[G0]]
+declare i8* @strcat(i8*, i8*)
+
+; CHECK: declare i8* @strchr(i8*, i32) [[G1]]
+declare i8* @strchr(i8*, i32)
+
+; CHECK: declare i32 @strcmp(i8* nocapture, i8* nocapture) [[G1]]
+declare i32 @strcmp(i8*, i8*)
+
+; CHECK: declare i32 @strcoll(i8* nocapture, i8* nocapture) [[G1]]
+declare i32 @strcoll(i8*, i8*)
+
+; CHECK: declare i8* @strcpy(i8*, i8* nocapture readonly) [[G0]]
+declare i8* @strcpy(i8*, i8*)
+
+; CHECK: declare i64 @strcspn(i8* nocapture, i8* nocapture) [[G1]]
+declare i64 @strcspn(i8*, i8*)
+
+; CHECK: declare noalias i8* @strdup(i8* nocapture readonly) [[G0]]
+declare i8* @strdup(i8*)
+
+; CHECK: declare i64 @strlen(i8* nocapture) [[G1]]
+declare i64 @strlen(i8*)
+
+; CHECK: declare i32 @strncasecmp(i8* nocapture, i8* nocapture, i64) [[G1]]
+declare i32 @strncasecmp(i8*, i8*, i64)
+
+; CHECK: declare i8* @strncat(i8*, i8* nocapture readonly, i64) [[G0]]
+declare i8* @strncat(i8*, i8*, i64)
+
+; CHECK: declare i32 @strncmp(i8* nocapture, i8* nocapture, i64) [[G1]]
+declare i32 @strncmp(i8*, i8*, i64)
+
+; CHECK: declare i8* @strncpy(i8*, i8* nocapture readonly, i64) [[G0]]
+declare i8* @strncpy(i8*, i8*, i64)
+
+; CHECK: declare noalias i8* @strndup(i8* nocapture readonly, i64) [[G0]]
+declare i8* @strndup(i8*, i64)
+
+; CHECK: declare i64 @strnlen(i8*, i64)
+declare i64 @strnlen(i8*, i64)
+
+; CHECK: declare i8* @strpbrk(i8*, i8* nocapture) [[G1]]
+declare i8* @strpbrk(i8*, i8*)
+
+; CHECK: declare i8* @strrchr(i8*, i32) [[G1]]
+declare i8* @strrchr(i8*, i32)
+
+; CHECK: declare i64 @strspn(i8* nocapture, i8* nocapture) [[G1]]
+declare i64 @strspn(i8*, i8*)
+
+; CHECK: declare i8* @strstr(i8*, i8* nocapture) [[G1]]
+declare i8* @strstr(i8*, i8*)
+
+; CHECK: declare double @strtod(i8* readonly, i8** nocapture) [[G0]]
+declare double @strtod(i8*, i8**)
+
+; CHECK: declare float @strtof(i8* readonly, i8** nocapture) [[G0]]
+declare float @strtof(i8*, i8**)
+
+; CHECK: declare i8* @strtok(i8*, i8* nocapture readonly) [[G0]]
+declare i8* @strtok(i8*, i8*)
+
+; CHECK: declare i8* @strtok_r(i8*, i8* nocapture readonly, i8**) [[G0]]
+declare i8* @strtok_r(i8*, i8*, i8**)
+
+; CHECK: declare i64 @strtol(i8* readonly, i8** nocapture, i32) [[G0]]
+declare i64 @strtol(i8*, i8**, i32)
+
+; CHECK: declare x86_fp80 @strtold(i8* readonly, i8** nocapture) [[G0]]
+declare x86_fp80 @strtold(i8*, i8**)
+
+; CHECK: declare i64 @strtoll(i8* readonly, i8** nocapture, i32) [[G0]]
+declare i64 @strtoll(i8*, i8**, i32)
+
+; CHECK: declare i64 @strtoul(i8* readonly, i8** nocapture, i32) [[G0]]
+declare i64 @strtoul(i8*, i8**, i32)
+
+; CHECK: declare i64 @strtoull(i8* readonly, i8** nocapture, i32) [[G0]]
+declare i64 @strtoull(i8*, i8**, i32)
+
+; CHECK: declare i64 @strxfrm(i8* nocapture, i8* nocapture readonly, i64) [[G0]]
+declare i64 @strxfrm(i8*, i8*, i64)
+
+; CHECK: declare i32 @system(i8* nocapture readonly)
+declare i32 @system(i8*)
+
+; CHECK: declare double @tan(double)
+declare double @tan(double)
+
+; CHECK: declare float @tanf(float)
+declare float @tanf(float)
+
+; CHECK: declare double @tanh(double)
+declare double @tanh(double)
+
+; CHECK: declare float @tanhf(float)
+declare float @tanhf(float)
+
+; CHECK: declare x86_fp80 @tanhl(x86_fp80)
+declare x86_fp80 @tanhl(x86_fp80)
+
+; CHECK: declare x86_fp80 @tanl(x86_fp80)
+declare x86_fp80 @tanl(x86_fp80)
+
+; CHECK: declare i64 @times(%opaque* nocapture) [[G0]]
+declare i64 @times(%opaque*)
+
+; CHECK: declare noalias %opaque* @tmpfile() [[G0]]
+declare %opaque* @tmpfile()
+
+; CHECK: declare i32 @toascii(i32)
+declare i32 @toascii(i32)
+
+; CHECK: declare double @trunc(double)
+declare double @trunc(double)
+
+; CHECK: declare float @truncf(float)
+declare float @truncf(float)
+
+; CHECK: declare x86_fp80 @truncl(x86_fp80)
+declare x86_fp80 @truncl(x86_fp80)
+
+; CHECK: declare i32 @uname(%opaque* nocapture) [[G0]]
+declare i32 @uname(%opaque*)
+
+; CHECK: declare i32 @ungetc(i32, %opaque* nocapture) [[G0]]
+declare i32 @ungetc(i32, %opaque*)
+
+; CHECK: declare i32 @unlink(i8* nocapture readonly) [[G0]]
+declare i32 @unlink(i8*)
+
+; CHECK: declare i32 @unsetenv(i8* nocapture readonly) [[G0]]
+declare i32 @unsetenv(i8*)
+
+; CHECK: declare i32 @utime(i8* nocapture readonly, %opaque* nocapture readonly) [[G0]]
+declare i32 @utime(i8*, %opaque*)
+
+; CHECK: declare i32 @utimes(i8* nocapture readonly, %opaque* nocapture readonly) [[G0]]
+declare i32 @utimes(i8*, %opaque*)
+
+; CHECK: declare noalias i8* @valloc(i64) [[G0]]
+declare i8* @valloc(i64)
+
+; CHECK: declare i32 @vfprintf(%opaque* nocapture, i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vfprintf(%opaque*, i8*, %opaque*)
+
+; CHECK: declare i32 @vfscanf(%opaque* nocapture, i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vfscanf(%opaque*, i8*, %opaque*)
+
+; CHECK: declare i32 @vprintf(i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vprintf(i8*, %opaque*)
+
+; CHECK: declare i32 @vscanf(i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vscanf(i8*, %opaque*)
+
+; CHECK: declare i32 @vsnprintf(i8* nocapture, i64, i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vsnprintf(i8*, i64, i8*, %opaque*)
+
+; CHECK: declare i32 @vsprintf(i8* nocapture, i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vsprintf(i8*, i8*, %opaque*)
+
+; CHECK: declare i32 @vsscanf(i8* nocapture readonly, i8* nocapture readonly, %opaque*) [[G0]]
+declare i32 @vsscanf(i8*, i8*, %opaque*)
+
+; CHECK: declare i64 @write(i32, i8* nocapture readonly, i64)
+declare i64 @write(i32, i8*, i64)
+
+
+; memset_pattern16 isn't available everywhere.
+; CHECK-DARWIN: declare void @memset_pattern16(i8* nocapture, i8* nocapture readonly, i64) [[G2:#[0-9]+]]
 declare void @memset_pattern16(i8*, i8*, i64)
-; CHECK: declare void @memset_pattern16(i8*, i8*, i64)
-; CHECK-POSIX: declare void @memset_pattern16(i8* nocapture, i8* nocapture readonly, i64) [[G2:#[0-9]+]]
 
-declare i32 @gettimeofday(i8*, i8*)
-; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]]
 
 ; CHECK: attributes [[G0]] = { nounwind }
 ; CHECK: attributes [[G1]] = { nounwind readonly }
-; CHECK-POSIX: attributes [[G0]] = { nounwind }
-; CHECK-POSIX: attributes [[G2]] = { argmemonly }
-
-declare i32 @__nvvm_reflect(i8*)
-; CHECK-NVPTX: declare i32 @__nvvm_reflect(i8*) [[G0:#[0-9]+]]
-; CHECK-NVPTX: attributes [[G0]] = { nounwind readnone }
+; CHECK-DARWIN: attributes [[G2]] = { argmemonly }

Added: llvm/trunk/test/Transforms/InferFunctionAttrs/no-proto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InferFunctionAttrs/no-proto.ll?rev=270750&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InferFunctionAttrs/no-proto.ll (added)
+++ llvm/trunk/test/Transforms/InferFunctionAttrs/no-proto.ll Wed May 25 15:22:45 2016
@@ -0,0 +1,819 @@
+; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck %s
+
+; Check that we don't modify libc functions with invalid prototypes.
+
+; CHECK: declare void @__cospi(...)
+declare void @__cospi(...)
+
+; CHECK: declare void @__cospif(...)
+declare void @__cospif(...)
+
+; CHECK: declare void @__sinpi(...)
+declare void @__sinpi(...)
+
+; CHECK: declare void @__sinpif(...)
+declare void @__sinpif(...)
+
+; CHECK: declare void @abs(...)
+declare void @abs(...)
+
+; CHECK: declare void @access(...)
+declare void @access(...)
+
+; CHECK: declare void @acos(...)
+declare void @acos(...)
+
+; CHECK: declare void @acosf(...)
+declare void @acosf(...)
+
+; CHECK: declare void @acosh(...)
+declare void @acosh(...)
+
+; CHECK: declare void @acoshf(...)
+declare void @acoshf(...)
+
+; CHECK: declare void @acoshl(...)
+declare void @acoshl(...)
+
+; CHECK: declare void @acosl(...)
+declare void @acosl(...)
+
+; CHECK: declare void @asin(...)
+declare void @asin(...)
+
+; CHECK: declare void @asinf(...)
+declare void @asinf(...)
+
+; CHECK: declare void @asinh(...)
+declare void @asinh(...)
+
+; CHECK: declare void @asinhf(...)
+declare void @asinhf(...)
+
+; CHECK: declare void @asinhl(...)
+declare void @asinhl(...)
+
+; CHECK: declare void @asinl(...)
+declare void @asinl(...)
+
+; CHECK: declare void @atan(...)
+declare void @atan(...)
+
+; CHECK: declare void @atan2(...)
+declare void @atan2(...)
+
+; CHECK: declare void @atan2f(...)
+declare void @atan2f(...)
+
+; CHECK: declare void @atan2l(...)
+declare void @atan2l(...)
+
+; CHECK: declare void @atanf(...)
+declare void @atanf(...)
+
+; CHECK: declare void @atanh(...)
+declare void @atanh(...)
+
+; CHECK: declare void @atanhf(...)
+declare void @atanhf(...)
+
+; CHECK: declare void @atanhl(...)
+declare void @atanhl(...)
+
+; CHECK: declare void @atanl(...)
+declare void @atanl(...)
+
+; CHECK: declare void @atof(...)
+declare void @atof(...)
+
+; CHECK: declare void @atoi(...)
+declare void @atoi(...)
+
+; CHECK: declare void @atol(...)
+declare void @atol(...)
+
+; CHECK: declare void @atoll(...)
+declare void @atoll(...)
+
+; CHECK: declare void @bcmp(...)
+declare void @bcmp(...)
+
+; CHECK: declare void @bcopy(...)
+declare void @bcopy(...)
+
+; CHECK: declare void @bzero(...)
+declare void @bzero(...)
+
+; CHECK: declare void @calloc(...)
+declare void @calloc(...)
+
+; CHECK: declare void @cbrt(...)
+declare void @cbrt(...)
+
+; CHECK: declare void @cbrtf(...)
+declare void @cbrtf(...)
+
+; CHECK: declare void @cbrtl(...)
+declare void @cbrtl(...)
+
+; CHECK: declare void @ceil(...)
+declare void @ceil(...)
+
+; CHECK: declare void @ceilf(...)
+declare void @ceilf(...)
+
+; CHECK: declare void @ceill(...)
+declare void @ceill(...)
+
+; CHECK: declare void @chmod(...)
+declare void @chmod(...)
+
+; CHECK: declare void @chown(...)
+declare void @chown(...)
+
+; CHECK: declare void @clearerr(...)
+declare void @clearerr(...)
+
+; CHECK: declare void @closedir(...)
+declare void @closedir(...)
+
+; CHECK: declare void @copysign(...)
+declare void @copysign(...)
+
+; CHECK: declare void @copysignf(...)
+declare void @copysignf(...)
+
+; CHECK: declare void @copysignl(...)
+declare void @copysignl(...)
+
+; CHECK: declare void @cos(...)
+declare void @cos(...)
+
+; CHECK: declare void @cosf(...)
+declare void @cosf(...)
+
+; CHECK: declare void @cosh(...)
+declare void @cosh(...)
+
+; CHECK: declare void @coshf(...)
+declare void @coshf(...)
+
+; CHECK: declare void @coshl(...)
+declare void @coshl(...)
+
+; CHECK: declare void @cosl(...)
+declare void @cosl(...)
+
+; CHECK: declare void @ctermid(...)
+declare void @ctermid(...)
+
+; CHECK: declare void @exp(...)
+declare void @exp(...)
+
+; CHECK: declare void @exp2(...)
+declare void @exp2(...)
+
+; CHECK: declare void @exp2f(...)
+declare void @exp2f(...)
+
+; CHECK: declare void @exp2l(...)
+declare void @exp2l(...)
+
+; CHECK: declare void @expf(...)
+declare void @expf(...)
+
+; CHECK: declare void @expl(...)
+declare void @expl(...)
+
+; CHECK: declare void @expm1(...)
+declare void @expm1(...)
+
+; CHECK: declare void @expm1f(...)
+declare void @expm1f(...)
+
+; CHECK: declare void @expm1l(...)
+declare void @expm1l(...)
+
+; CHECK: declare void @fabs(...)
+declare void @fabs(...)
+
+; CHECK: declare void @fabsf(...)
+declare void @fabsf(...)
+
+; CHECK: declare void @fabsl(...)
+declare void @fabsl(...)
+
+; CHECK: declare void @fclose(...)
+declare void @fclose(...)
+
+; CHECK: declare void @fdopen(...)
+declare void @fdopen(...)
+
+; CHECK: declare void @feof(...)
+declare void @feof(...)
+
+; CHECK: declare void @ferror(...)
+declare void @ferror(...)
+
+; CHECK: declare void @fflush(...)
+declare void @fflush(...)
+
+; CHECK: declare void @ffs(...)
+declare void @ffs(...)
+
+; CHECK: declare void @ffsl(...)
+declare void @ffsl(...)
+
+; CHECK: declare void @ffsll(...)
+declare void @ffsll(...)
+
+; CHECK: declare void @fgetc(...)
+declare void @fgetc(...)
+
+; CHECK: declare void @fgetpos(...)
+declare void @fgetpos(...)
+
+; CHECK: declare void @fgets(...)
+declare void @fgets(...)
+
+; CHECK: declare void @fileno(...)
+declare void @fileno(...)
+
+; CHECK: declare void @flockfile(...)
+declare void @flockfile(...)
+
+; CHECK: declare void @floor(...)
+declare void @floor(...)
+
+; CHECK: declare void @floorf(...)
+declare void @floorf(...)
+
+; CHECK: declare void @floorl(...)
+declare void @floorl(...)
+
+; CHECK: declare void @fls(...)
+declare void @fls(...)
+
+; CHECK: declare void @flsl(...)
+declare void @flsl(...)
+
+; CHECK: declare void @flsll(...)
+declare void @flsll(...)
+
+; CHECK: declare void @fmax(...)
+declare void @fmax(...)
+
+; CHECK: declare void @fmaxf(...)
+declare void @fmaxf(...)
+
+; CHECK: declare void @fmaxl(...)
+declare void @fmaxl(...)
+
+; CHECK: declare void @fmin(...)
+declare void @fmin(...)
+
+; CHECK: declare void @fminf(...)
+declare void @fminf(...)
+
+; CHECK: declare void @fminl(...)
+declare void @fminl(...)
+
+; CHECK: declare void @fmod(...)
+declare void @fmod(...)
+
+; CHECK: declare void @fmodf(...)
+declare void @fmodf(...)
+
+; CHECK: declare void @fmodl(...)
+declare void @fmodl(...)
+
+; CHECK: declare void @fopen(...)
+declare void @fopen(...)
+
+; CHECK: declare void @fprintf(...)
+declare void @fprintf(...)
+
+; CHECK: declare void @fputc(...)
+declare void @fputc(...)
+
+; CHECK: declare void @fputs(...)
+declare void @fputs(...)
+
+; CHECK: declare void @fread(...)
+declare void @fread(...)
+
+; CHECK: declare void @free(...)
+declare void @free(...)
+
+; CHECK: declare void @frexp(...)
+declare void @frexp(...)
+
+; CHECK: declare void @frexpf(...)
+declare void @frexpf(...)
+
+; CHECK: declare void @frexpl(...)
+declare void @frexpl(...)
+
+; CHECK: declare void @fscanf(...)
+declare void @fscanf(...)
+
+; CHECK: declare void @fseek(...)
+declare void @fseek(...)
+
+; CHECK: declare void @fseeko(...)
+declare void @fseeko(...)
+
+; CHECK: declare void @fsetpos(...)
+declare void @fsetpos(...)
+
+; CHECK: declare void @fstat(...)
+declare void @fstat(...)
+
+; CHECK: declare void @fstatvfs(...)
+declare void @fstatvfs(...)
+
+; CHECK: declare void @ftell(...)
+declare void @ftell(...)
+
+; CHECK: declare void @ftello(...)
+declare void @ftello(...)
+
+; CHECK: declare void @ftrylockfile(...)
+declare void @ftrylockfile(...)
+
+; CHECK: declare void @funlockfile(...)
+declare void @funlockfile(...)
+
+; CHECK: declare void @fwrite(...)
+declare void @fwrite(...)
+
+; CHECK: declare void @getc(...)
+declare void @getc(...)
+
+; CHECK: declare void @getc_unlocked(...)
+declare void @getc_unlocked(...)
+
+; CHECK: declare void @getchar(...)
+declare void @getchar(...)
+
+; CHECK: declare void @getenv(...)
+declare void @getenv(...)
+
+; CHECK: declare void @getitimer(...)
+declare void @getitimer(...)
+
+; CHECK: declare void @getlogin_r(...)
+declare void @getlogin_r(...)
+
+; CHECK: declare void @getpwnam(...)
+declare void @getpwnam(...)
+
+; CHECK: declare void @gets(...)
+declare void @gets(...)
+
+; CHECK: declare void @gettimeofday(...)
+declare void @gettimeofday(...)
+
+; CHECK: declare void @isascii(...)
+declare void @isascii(...)
+
+; CHECK: declare void @isdigit(...)
+declare void @isdigit(...)
+
+; CHECK: declare void @labs(...)
+declare void @labs(...)
+
+; CHECK: declare void @lchown(...)
+declare void @lchown(...)
+
+; CHECK: declare void @ldexp(...)
+declare void @ldexp(...)
+
+; CHECK: declare void @ldexpf(...)
+declare void @ldexpf(...)
+
+; CHECK: declare void @ldexpl(...)
+declare void @ldexpl(...)
+
+; CHECK: declare void @llabs(...)
+declare void @llabs(...)
+
+; CHECK: declare void @log(...)
+declare void @log(...)
+
+; CHECK: declare void @log10(...)
+declare void @log10(...)
+
+; CHECK: declare void @log10f(...)
+declare void @log10f(...)
+
+; CHECK: declare void @log10l(...)
+declare void @log10l(...)
+
+; CHECK: declare void @log1p(...)
+declare void @log1p(...)
+
+; CHECK: declare void @log1pf(...)
+declare void @log1pf(...)
+
+; CHECK: declare void @log1pl(...)
+declare void @log1pl(...)
+
+; CHECK: declare void @log2(...)
+declare void @log2(...)
+
+; CHECK: declare void @log2f(...)
+declare void @log2f(...)
+
+; CHECK: declare void @log2l(...)
+declare void @log2l(...)
+
+; CHECK: declare void @logb(...)
+declare void @logb(...)
+
+; CHECK: declare void @logbf(...)
+declare void @logbf(...)
+
+; CHECK: declare void @logbl(...)
+declare void @logbl(...)
+
+; CHECK: declare void @logf(...)
+declare void @logf(...)
+
+; CHECK: declare void @logl(...)
+declare void @logl(...)
+
+; CHECK: declare void @lstat(...)
+declare void @lstat(...)
+
+; CHECK: declare void @malloc(...)
+declare void @malloc(...)
+
+; CHECK: declare void @memccpy(...)
+declare void @memccpy(...)
+
+; CHECK: declare void @memchr(...)
+declare void @memchr(...)
+
+; CHECK: declare void @memcmp(...)
+declare void @memcmp(...)
+
+; CHECK: declare void @memcpy(...)
+declare void @memcpy(...)
+
+; CHECK: declare void @memmove(...)
+declare void @memmove(...)
+
+; CHECK: declare void @memset(...)
+declare void @memset(...)
+
+; CHECK: declare void @memset_pattern16(...)
+declare void @memset_pattern16(...)
+
+; CHECK: declare void @mkdir(...)
+declare void @mkdir(...)
+
+; CHECK: declare void @mktime(...)
+declare void @mktime(...)
+
+; CHECK: declare void @modf(...)
+declare void @modf(...)
+
+; CHECK: declare void @modff(...)
+declare void @modff(...)
+
+; CHECK: declare void @modfl(...)
+declare void @modfl(...)
+
+; CHECK: declare void @nearbyint(...)
+declare void @nearbyint(...)
+
+; CHECK: declare void @nearbyintf(...)
+declare void @nearbyintf(...)
+
+; CHECK: declare void @nearbyintl(...)
+declare void @nearbyintl(...)
+
+; CHECK: declare void @open(...)
+declare void @open(...)
+
+; CHECK: declare void @opendir(...)
+declare void @opendir(...)
+
+; CHECK: declare void @pclose(...)
+declare void @pclose(...)
+
+; CHECK: declare void @perror(...)
+declare void @perror(...)
+
+; CHECK: declare void @popen(...)
+declare void @popen(...)
+
+; CHECK: declare void @posix_memalign(...)
+declare void @posix_memalign(...)
+
+; CHECK: declare void @pow(...)
+declare void @pow(...)
+
+; CHECK: declare void @powf(...)
+declare void @powf(...)
+
+; CHECK: declare void @powl(...)
+declare void @powl(...)
+
+; CHECK: declare void @pread(...)
+declare void @pread(...)
+
+; CHECK: declare void @printf(...)
+declare void @printf(...)
+
+; CHECK: declare void @putc(...)
+declare void @putc(...)
+
+; CHECK: declare void @putchar(...)
+declare void @putchar(...)
+
+; CHECK: declare void @puts(...)
+declare void @puts(...)
+
+; CHECK: declare void @pwrite(...)
+declare void @pwrite(...)
+
+; CHECK: declare void @qsort(...)
+declare void @qsort(...)
+
+; CHECK: declare void @read(...)
+declare void @read(...)
+
+; CHECK: declare void @readlink(...)
+declare void @readlink(...)
+
+; CHECK: declare void @realloc(...)
+declare void @realloc(...)
+
+; CHECK: declare void @reallocf(...)
+declare void @reallocf(...)
+
+; CHECK: declare void @realpath(...)
+declare void @realpath(...)
+
+; CHECK: declare void @remove(...)
+declare void @remove(...)
+
+; CHECK: declare void @rename(...)
+declare void @rename(...)
+
+; CHECK: declare void @rewind(...)
+declare void @rewind(...)
+
+; CHECK: declare void @rint(...)
+declare void @rint(...)
+
+; CHECK: declare void @rintf(...)
+declare void @rintf(...)
+
+; CHECK: declare void @rintl(...)
+declare void @rintl(...)
+
+; CHECK: declare void @rmdir(...)
+declare void @rmdir(...)
+
+; CHECK: declare void @round(...)
+declare void @round(...)
+
+; CHECK: declare void @roundf(...)
+declare void @roundf(...)
+
+; CHECK: declare void @roundl(...)
+declare void @roundl(...)
+
+; CHECK: declare void @scanf(...)
+declare void @scanf(...)
+
+; CHECK: declare void @setbuf(...)
+declare void @setbuf(...)
+
+; CHECK: declare void @setitimer(...)
+declare void @setitimer(...)
+
+; CHECK: declare void @setvbuf(...)
+declare void @setvbuf(...)
+
+; CHECK: declare void @sin(...)
+declare void @sin(...)
+
+; CHECK: declare void @sinf(...)
+declare void @sinf(...)
+
+; CHECK: declare void @sinh(...)
+declare void @sinh(...)
+
+; CHECK: declare void @sinhf(...)
+declare void @sinhf(...)
+
+; CHECK: declare void @sinhl(...)
+declare void @sinhl(...)
+
+; CHECK: declare void @sinl(...)
+declare void @sinl(...)
+
+; CHECK: declare void @snprintf(...)
+declare void @snprintf(...)
+
+; CHECK: declare void @sprintf(...)
+declare void @sprintf(...)
+
+; CHECK: declare void @sqrt(...)
+declare void @sqrt(...)
+
+; CHECK: declare void @sqrtf(...)
+declare void @sqrtf(...)
+
+; CHECK: declare void @sqrtl(...)
+declare void @sqrtl(...)
+
+; CHECK: declare void @sscanf(...)
+declare void @sscanf(...)
+
+; CHECK: declare void @stat(...)
+declare void @stat(...)
+
+; CHECK: declare void @statvfs(...)
+declare void @statvfs(...)
+
+; CHECK: declare void @stpcpy(...)
+declare void @stpcpy(...)
+
+; CHECK: declare void @stpncpy(...)
+declare void @stpncpy(...)
+
+; CHECK: declare void @strcasecmp(...)
+declare void @strcasecmp(...)
+
+; CHECK: declare void @strcat(...)
+declare void @strcat(...)
+
+; CHECK: declare void @strchr(...)
+declare void @strchr(...)
+
+; CHECK: declare void @strcmp(...)
+declare void @strcmp(...)
+
+; CHECK: declare void @strcoll(...)
+declare void @strcoll(...)
+
+; CHECK: declare void @strcpy(...)
+declare void @strcpy(...)
+
+; CHECK: declare void @strcspn(...)
+declare void @strcspn(...)
+
+; CHECK: declare void @strdup(...)
+declare void @strdup(...)
+
+; CHECK: declare void @strlen(...)
+declare void @strlen(...)
+
+; CHECK: declare void @strncasecmp(...)
+declare void @strncasecmp(...)
+
+; CHECK: declare void @strncat(...)
+declare void @strncat(...)
+
+; CHECK: declare void @strncmp(...)
+declare void @strncmp(...)
+
+; CHECK: declare void @strncpy(...)
+declare void @strncpy(...)
+
+; CHECK: declare void @strndup(...)
+declare void @strndup(...)
+
+; CHECK: declare void @strnlen(...)
+declare void @strnlen(...)
+
+; CHECK: declare void @strpbrk(...)
+declare void @strpbrk(...)
+
+; CHECK: declare void @strrchr(...)
+declare void @strrchr(...)
+
+; CHECK: declare void @strspn(...)
+declare void @strspn(...)
+
+; CHECK: declare void @strstr(...)
+declare void @strstr(...)
+
+; CHECK: declare void @strtod(...)
+declare void @strtod(...)
+
+; CHECK: declare void @strtof(...)
+declare void @strtof(...)
+
+; CHECK: declare void @strtok(...)
+declare void @strtok(...)
+
+; CHECK: declare void @strtok_r(...)
+declare void @strtok_r(...)
+
+; CHECK: declare void @strtol(...)
+declare void @strtol(...)
+
+; CHECK: declare void @strtold(...)
+declare void @strtold(...)
+
+; CHECK: declare void @strtoll(...)
+declare void @strtoll(...)
+
+; CHECK: declare void @strtoul(...)
+declare void @strtoul(...)
+
+; CHECK: declare void @strtoull(...)
+declare void @strtoull(...)
+
+; CHECK: declare void @strxfrm(...)
+declare void @strxfrm(...)
+
+; CHECK: declare void @system(...)
+declare void @system(...)
+
+; CHECK: declare void @tan(...)
+declare void @tan(...)
+
+; CHECK: declare void @tanf(...)
+declare void @tanf(...)
+
+; CHECK: declare void @tanh(...)
+declare void @tanh(...)
+
+; CHECK: declare void @tanhf(...)
+declare void @tanhf(...)
+
+; CHECK: declare void @tanhl(...)
+declare void @tanhl(...)
+
+; CHECK: declare void @tanl(...)
+declare void @tanl(...)
+
+; CHECK: declare void @times(...)
+declare void @times(...)
+
+; CHECK: declare void @tmpfile(...)
+declare void @tmpfile(...)
+
+; CHECK: declare void @toascii(...)
+declare void @toascii(...)
+
+; CHECK: declare void @trunc(...)
+declare void @trunc(...)
+
+; CHECK: declare void @truncf(...)
+declare void @truncf(...)
+
+; CHECK: declare void @truncl(...)
+declare void @truncl(...)
+
+; CHECK: declare void @uname(...)
+declare void @uname(...)
+
+; CHECK: declare void @ungetc(...)
+declare void @ungetc(...)
+
+; CHECK: declare void @unlink(...)
+declare void @unlink(...)
+
+; CHECK: declare void @unsetenv(...)
+declare void @unsetenv(...)
+
+; CHECK: declare void @utime(...)
+declare void @utime(...)
+
+; CHECK: declare void @utimes(...)
+declare void @utimes(...)
+
+; CHECK: declare void @valloc(...)
+declare void @valloc(...)
+
+; CHECK: declare void @vfprintf(...)
+declare void @vfprintf(...)
+
+; CHECK: declare void @vfscanf(...)
+declare void @vfscanf(...)
+
+; CHECK: declare void @vprintf(...)
+declare void @vprintf(...)
+
+; CHECK: declare void @vscanf(...)
+declare void @vscanf(...)
+
+; CHECK: declare void @vsnprintf(...)
+declare void @vsnprintf(...)
+
+; CHECK: declare void @vsprintf(...)
+declare void @vsprintf(...)
+
+; CHECK: declare void @vsscanf(...)
+declare void @vsscanf(...)
+
+; CHECK: declare void @write(...)
+declare void @write(...)




More information about the llvm-commits mailing list