Index: llvm/lib/Transforms/Utils/BuildLibCalls.cpp =================================================================== --- llvm/lib/Transforms/Utils/BuildLibCalls.cpp +++ llvm/lib/Transforms/Utils/BuildLibCalls.cpp @@ -264,18 +264,21 @@ return Changed; case LibFunc_strchr: case LibFunc_strrchr: + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setOnlyAccessesArgMemory(F); Changed |= setOnlyReadsMemory(F); Changed |= setDoesNotThrow(F); Changed |= setWillReturn(F); return Changed; case LibFunc_strtol: + case LibFunc_strtoll: + case LibFunc_strtoul: + case LibFunc_strtoull: + Changed |= setArgExtAttr(F, 2, TLI); + LLVM_FALLTHROUGH; case LibFunc_strtod: case LibFunc_strtof: - case LibFunc_strtoul: - case LibFunc_strtoll: case LibFunc_strtold: - case LibFunc_strtoull: Changed |= setDoesNotThrow(F); Changed |= setWillReturn(F); Changed |= setDoesNotCapture(F, 1); @@ -357,8 +360,10 @@ Changed |= setDoesNotCapture(F, 0); Changed |= setOnlyReadsMemory(F, 0); return Changed; - case LibFunc_setbuf: case LibFunc_setvbuf: + Changed |= setArgExtAttr(F, 2, TLI); + LLVM_FALLTHROUGH; + case LibFunc_setbuf: Changed |= setRetAndArgsNoUndef(F); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 0); @@ -410,6 +415,7 @@ return Changed; case LibFunc_setitimer: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setWillReturn(F); Changed |= setDoesNotCapture(F, 1); @@ -444,6 +450,7 @@ return Changed; case LibFunc_memchr: case LibFunc_memrchr: + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setDoesNotThrow(F); Changed |= setOnlyAccessesArgMemory(F); Changed |= setOnlyReadsMemory(F); @@ -476,8 +483,10 @@ Changed |= setDoesNotCapture(F, 1); Changed |= setOnlyReadsMemory(F, 1); return Changed; - case LibFunc_mempcpy: case LibFunc_memccpy: + Changed |= setArgExtAttr(F, 2, TLI); + LLVM_FALLTHROUGH; + case LibFunc_mempcpy: Changed |= setWillReturn(F); LLVM_FALLTHROUGH; case LibFunc_memcpy_chk: @@ -523,6 +532,7 @@ case LibFunc_read: // May throw; "read" is a valid pthread cancellation point. Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotCapture(F, 1); return Changed; case LibFunc_rewind: @@ -556,6 +566,7 @@ case LibFunc_write: // May throw; "write" is a valid pthread cancellation point. Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotCapture(F, 1); Changed |= setOnlyReadsMemory(F, 1); return Changed; @@ -592,7 +603,6 @@ Changed |= setWillReturn(F); return Changed; case LibFunc_chmod: - case LibFunc_chown: Changed |= setRetAndArgsNoUndef(F); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 0); @@ -616,6 +626,7 @@ return Changed; case LibFunc_access: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 0); Changed |= setOnlyReadsMemory(F, 0); @@ -631,6 +642,7 @@ return Changed; case LibFunc_fdopen: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setRetDoesNotAlias(F); Changed |= setDoesNotCapture(F, 1); @@ -650,10 +662,12 @@ Changed |= setDoesNotCapture(F, 0); return Changed; case LibFunc_fseek: + case LibFunc_fseeko: + Changed |= setArgExtAttr(F, 2, TLI); + LLVM_FALLTHROUGH; case LibFunc_ftell: case LibFunc_fgetc: case LibFunc_fgetc_unlocked: - case LibFunc_fseeko: case LibFunc_ftello: case LibFunc_fileno: case LibFunc_fflush: @@ -676,6 +690,7 @@ case LibFunc_fputc_unlocked: case LibFunc_fstat: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 1); return Changed; @@ -688,12 +703,14 @@ return Changed; case LibFunc_fstatvfs: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 1); return Changed; case LibFunc_fgets: case LibFunc_fgets_unlocked: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 2); return Changed; @@ -735,6 +752,7 @@ Changed |= setDoesNotCapture(F, 1); return Changed; case LibFunc_getc: + case LibFunc_under_IO_getc: Changed |= setRetAndArgsNoUndef(F); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 0); @@ -763,6 +781,7 @@ return Changed; case LibFunc_getitimer: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 1); return Changed; @@ -774,6 +793,7 @@ return Changed; case LibFunc_ungetc: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 1); return Changed; @@ -805,7 +825,9 @@ return Changed; case LibFunc_putc: case LibFunc_putc_unlocked: + case LibFunc_under_IO_putc: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 1); return Changed; @@ -820,11 +842,13 @@ case LibFunc_pread: // May throw; "pread" is a valid pthread cancellation point. Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotCapture(F, 1); return Changed; case LibFunc_pwrite: // May throw; "pwrite" is a valid pthread cancellation point. Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotCapture(F, 1); Changed |= setOnlyReadsMemory(F, 1); return Changed; @@ -893,6 +917,7 @@ case LibFunc_open: // May throw; "open" is a valid pthread cancellation point. Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setDoesNotCapture(F, 0); Changed |= setOnlyReadsMemory(F, 0); return Changed; @@ -917,6 +942,7 @@ case LibFunc_htons: case LibFunc_ntohl: case LibFunc_ntohs: + Changed |= setArgExtAttr(F, 0, TLI, false/*Signed*/); Changed |= setDoesNotThrow(F); Changed |= setDoesNotAccessMemory(F); return Changed; @@ -927,12 +953,6 @@ Changed |= setDoesNotCapture(F, 1); Changed |= setOnlyReadsMemory(F, 0); return Changed; - case LibFunc_lchown: - Changed |= setRetAndArgsNoUndef(F); - Changed |= setDoesNotThrow(F); - Changed |= setDoesNotCapture(F, 0); - Changed |= setOnlyReadsMemory(F, 0); - return Changed; case LibFunc_qsort: // May throw; places call through function pointer. // Cannot give undef pointer/size @@ -954,16 +974,6 @@ Changed |= setDoesNotCapture(F, 1); Changed |= setOnlyReadsMemory(F, 1); return Changed; - case LibFunc_under_IO_getc: - Changed |= setRetAndArgsNoUndef(F); - Changed |= setDoesNotThrow(F); - Changed |= setDoesNotCapture(F, 0); - return Changed; - case LibFunc_under_IO_putc: - Changed |= setRetAndArgsNoUndef(F); - Changed |= setDoesNotThrow(F); - Changed |= setDoesNotCapture(F, 1); - return Changed; case LibFunc_dunder_isoc99_scanf: Changed |= setRetAndArgsNoUndef(F); Changed |= setDoesNotThrow(F); @@ -997,6 +1007,8 @@ Changed |= setOnlyReadsMemory(F, 1); return Changed; case LibFunc_fseeko64: + Changed |= setArgExtAttr(F, 2, TLI); + LLVM_FALLTHROUGH; case LibFunc_ftello64: Changed |= setRetAndArgsNoUndef(F); Changed |= setDoesNotThrow(F); @@ -1010,12 +1022,14 @@ case LibFunc_fstat64: case LibFunc_fstatvfs64: Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 0, TLI); Changed |= setDoesNotThrow(F); Changed |= setDoesNotCapture(F, 1); return Changed; case LibFunc_open64: // May throw; "open" is a valid pthread cancellation point. Changed |= setRetAndArgsNoUndef(F); + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setDoesNotCapture(F, 0); Changed |= setOnlyReadsMemory(F, 0); return Changed; @@ -1039,6 +1053,7 @@ Changed |= setWillReturn(F); LLVM_FALLTHROUGH; case LibFunc_memset_chk: + Changed |= setArgExtAttr(F, 1, TLI); Changed |= setOnlyAccessesArgMemory(F); Changed |= setOnlyWritesMemory(F, 0); Changed |= setDoesNotThrow(F); @@ -1056,6 +1071,12 @@ Changed |= setWillReturn(F); return Changed; case LibFunc_abs: + case LibFunc_ffs: + case LibFunc_isascii: + case LibFunc_isdigit: + case LibFunc_toascii: + Changed |= setArgExtAttr(F, 0, TLI); + LLVM_FALLTHROUGH; case LibFunc_acos: case LibFunc_acosf: case LibFunc_acosh: @@ -1106,7 +1127,6 @@ case LibFunc_fabs: case LibFunc_fabsf: case LibFunc_fabsl: - case LibFunc_ffs: case LibFunc_ffsl: case LibFunc_ffsll: case LibFunc_floor: @@ -1124,8 +1144,6 @@ case LibFunc_fmod: case LibFunc_fmodf: case LibFunc_fmodl: - case LibFunc_isascii: - case LibFunc_isdigit: case LibFunc_labs: case LibFunc_llabs: case LibFunc_log: @@ -1173,7 +1191,6 @@ case LibFunc_tanhf: case LibFunc_tanhl: case LibFunc_tanl: - case LibFunc_toascii: case LibFunc_trunc: case LibFunc_truncf: case LibFunc_truncl: Index: llvm/test/Transforms/InferFunctionAttrs/annotate.ll =================================================================== --- llvm/test/Transforms/InferFunctionAttrs/annotate.ll +++ llvm/test/Transforms/InferFunctionAttrs/annotate.ll @@ -197,9 +197,11 @@ declare float @__sinpif(float) ; CHECK: declare i32 @abs(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY:#[0-9]+]] +; CHECK-SYSTEMZ: declare i32 @abs(i32 signext) declare i32 @abs(i32) ; CHECK: declare noundef i32 @access(i8* nocapture noundef readonly, i32 noundef) [[NOFREE_NOUNWIND:#[0-9]+]] +; CHECK-SYSTEMZ: declare noundef i32 @access(i8* nocapture noundef readonly, i32 noundef signext) declare i32 @access(i8*, i32) ; CHECK: declare double @acos(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] @@ -314,9 +316,6 @@ ; CHECK: declare noundef i32 @chmod(i8* nocapture noundef readonly, i16 noundef zeroext) [[NOFREE_NOUNWIND]] declare i32 @chmod(i8*, i16 zeroext) -; CHECK: declare noundef i32 @chown(i8* nocapture noundef readonly, i32 noundef, i32 noundef) [[NOFREE_NOUNWIND]] -declare i32 @chown(i8*, i32, i32) - ; CHECK: declare void @clearerr(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] declare void @clearerr(%opaque*) @@ -393,6 +392,7 @@ declare i32 @fclose(%opaque*) ; CHECK: declare noalias noundef %opaque* @fdopen(i32 noundef, i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noalias noundef %opaque* @fdopen(i32 noundef signext, i8* nocapture noundef readonly) declare %opaque* @fdopen(i32, i8*) ; CHECK: declare noundef i32 @feof(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] @@ -405,6 +405,7 @@ declare i32 @fflush(%opaque*) ; CHECK: declare i32 @ffs(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] +; CHECK-SYSTEMZ: declare i32 @ffs(i32 signext) declare i32 @ffs(i32) ; CHECK-KNOWN: declare i32 @ffsl(i64) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] @@ -422,8 +423,12 @@ declare i32 @fgetpos(%opaque*, i64*) ; CHECK: declare noundef i8* @fgets(i8* noundef, i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i8* @fgets(i8* noundef, i32 noundef signext, %opaque* nocapture noundef) declare i8* @fgets(i8*, i32, %opaque*) +; CHECK-SYSTEMZ: declare noundef i8* @fgets_unlocked(i8* noundef, i32 noundef signext, %opaque* nocapture noundef) +declare i8* @fgets_unlocked(i8*, i32, %opaque*) + ; CHECK: declare noundef i32 @fileno(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] declare i32 @fileno(%opaque*) @@ -482,8 +487,12 @@ declare i32 @fprintf(%opaque*, i8*, ...) ; CHECK: declare noundef i32 @fputc(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fputc(i32 noundef signext, %opaque* nocapture noundef) declare i32 @fputc(i32, %opaque*) +; CHECK-SYSTEMZ: declare noundef i32 @fputc_unlocked(i32 noundef signext, %opaque* nocapture noundef) +declare i32 @fputc_unlocked(i32, %opaque*) + ; CHECK: declare noundef i32 @fputs(i8* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] declare i32 @fputs(i8*, %opaque*) @@ -506,27 +515,34 @@ declare i32 @fscanf(%opaque*, i8*, ...) ; CHECK: declare noundef i32 @fseek(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fseek(%opaque* nocapture noundef, i64 noundef, i32 noundef signext) declare i32 @fseek(%opaque*, i64, i32) ; CHECK: declare noundef i32 @fseeko(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fseeko(%opaque* nocapture noundef, i64 noundef, i32 noundef signext) declare i32 @fseeko(%opaque*, i64, i32) ; CHECK-LINUX: declare noundef i32 @fseeko64(%opaque* nocapture noundef, i64 noundef, i32 noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fseeko64(%opaque* nocapture noundef, i64 noundef, i32 noundef signext) declare i32 @fseeko64(%opaque*, i64, i32) ; CHECK: declare noundef i32 @fsetpos(%opaque* nocapture noundef, i64* noundef) [[NOFREE_NOUNWIND]] declare i32 @fsetpos(%opaque*, i64*) ; CHECK: declare noundef i32 @fstat(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fstat(i32 noundef signext, %opaque* nocapture noundef) declare i32 @fstat(i32, %opaque*) ; CHECK-LINUX: declare noundef i32 @fstat64(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fstat64(i32 noundef signext, %opaque* nocapture noundef) declare i32 @fstat64(i32, %opaque*) ; CHECK: declare noundef i32 @fstatvfs(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fstatvfs(i32 noundef signext, %opaque* nocapture noundef) declare i32 @fstatvfs(i32, %opaque*) ; CHECK-LINUX: declare noundef i32 @fstatvfs64(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @fstatvfs64(i32 noundef signext, %opaque* nocapture noundef) declare i32 @fstatvfs64(i32, %opaque*) ; CHECK: declare noundef i64 @ftell(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] @@ -565,6 +581,7 @@ declare i8* @getenv(i8*) ; CHECK: declare noundef i32 @getitimer(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @getitimer(i32 noundef signext, %opaque* nocapture noundef) declare i32 @getitimer(i32, %opaque*) ; CHECK: declare noundef i32 @getlogin_r(i8* nocapture noundef, i64 noundef) [[NOFREE_NOUNWIND]] @@ -579,18 +596,23 @@ ; CHECK: declare noundef i32 @gettimeofday(%opaque* nocapture noundef, i8* nocapture noundef) [[NOFREE_NOUNWIND]] declare i32 @gettimeofday(%opaque*, i8*) +; CHECK-SYSTEMZ: declare i32 @htonl(i32 zeroext) +declare i32 @htonl(i32) + +; CHECK-SYSTEMZ: declare i16 @htons(i16 zeroext) +declare i16 @htons(i16) + ; CHECK: declare i32 @isascii(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] +; CHECK-SYSTEMZ: declare i32 @isascii(i32 signext) declare i32 @isascii(i32) ; CHECK: declare i32 @isdigit(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] +; CHECK-SYSTEMZ: declare i32 @isdigit(i32 signext) declare i32 @isdigit(i32) ; CHECK: declare i64 @labs(i64) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] declare i64 @labs(i64) -; CHECK: declare noundef i32 @lchown(i8* nocapture noundef readonly, i32 noundef, i32 noundef) [[NOFREE_NOUNWIND]] -declare i32 @lchown(i8*, i32, i32) - ; CHECK: declare double @ldexp(double, i32) [[NOFREE_WILLRETURN:#[0-9]+]] ; CHECK-SYSTEMZ: declare double @ldexp(double, i32 signext) declare double @ldexp(double, i32) @@ -663,13 +685,18 @@ declare i8* @memalign(i64, i64) ; CHECK: declare i8* @memccpy(i8* noalias writeonly, i8* noalias nocapture readonly, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] +; CHECK-SYSTEMZ: declare i8* @memccpy(i8* noalias writeonly, i8* noalias nocapture readonly, i32 signext, i64) declare i8* @memccpy(i8*, i8*, i32, i64) ; CHECK-LINUX: declare i8* @memchr(i8*, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]] ; CHECK-DARWIN: declare i8* @memchr(i8*, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]] ; CHECK-UNKNOWN: declare i8* @memchr(i8*, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]] +; CHECK-SYSTEMZ: declare i8* @memchr(i8*, i32 signext, i64) declare i8* @memchr(i8*, i32, i64) +; CHECK-SYSTEMZ: declare i8* @memrchr(i8*, i32 signext, i64) +declare i8* @memrchr(i8*, i32, i64) + ; CHECK: declare i32 @memcmp(i8* nocapture, i8* nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]] declare i32 @memcmp(i8*, i8*, i64) @@ -686,9 +713,11 @@ declare i8* @memmove(i8*, i8*, i64) ; CHECK: declare i8* @memset(i8* writeonly, i32, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]] +; CHECK-SYSTEMZ: declare i8* @memset(i8* writeonly, i32 signext, i64) declare i8* @memset(i8*, i32, i64) ; CHECK: declare i8* @__memset_chk(i8* writeonly, i32, i64, i64) [[ARGMEMONLY_NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare i8* @__memset_chk(i8* writeonly, i32 signext, i64, i64) declare i8* @__memset_chk(i8*, i32, i64, i64) ; CHECK: declare noundef i32 @mkdir(i8* nocapture noundef readonly, i16 noundef zeroext) [[NOFREE_NOUNWIND]] @@ -715,11 +744,19 @@ ; CHECK: declare x86_fp80 @nearbyintl(x86_fp80) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] declare x86_fp80 @nearbyintl(x86_fp80) +; CHECK-SYSTEMZ: declare i32 @ntohl(i32 zeroext) +declare i32 @ntohl(i32) + +; CHECK-SYSTEMZ: declare i16 @ntohs(i16 zeroext) +declare i16 @ntohs(i16) + ; CHECK-LINUX: declare noundef i32 @open(i8* nocapture noundef readonly, i32 noundef, ...) [[NOFREE]] ; CHECK-OPEN: declare noundef i32 @open(i8* nocapture noundef readonly, i32 noundef, ...) [[NOFREE:#[0-9]+]] +; CHECK-SYSTEMZ: declare noundef i32 @open(i8* nocapture noundef readonly, i32 noundef signext, ...) declare i32 @open(i8*, i32, ...) ; CHECK-LINUX: declare noundef i32 @open64(i8* nocapture noundef readonly, i32 noundef, ...) [[NOFREE]] +; CHECK-SYSTEMZ: declare noundef i32 @open64(i8* nocapture noundef readonly, i32 noundef signext, ...) declare i32 @open64(i8*, i32, ...) ; CHECK: declare noalias noundef %opaque* @opendir(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]] @@ -747,14 +784,19 @@ declare x86_fp80 @powl(x86_fp80, x86_fp80) ; CHECK: declare noundef i64 @pread(i32 noundef, i8* nocapture noundef, i64 noundef, i64 noundef) [[NOFREE]] +; CHECK-SYSTEMZ: declare noundef i64 @pread(i32 noundef signext, i8* nocapture noundef, i64 noundef, i64 noundef) declare i64 @pread(i32, i8*, i64, i64) ; CHECK: declare noundef i32 @printf(i8* nocapture noundef readonly, ...) [[NOFREE_NOUNWIND]] declare i32 @printf(i8*, ...) ; CHECK: declare noundef i32 @putc(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @putc(i32 noundef signext, %opaque* nocapture noundef) declare i32 @putc(i32, %opaque*) +; CHECK-SYSTEMZ: declare noundef i32 @putc_unlocked(i32 noundef signext, %opaque* nocapture noundef) +declare i32 @putc_unlocked(i32, %opaque*) + ; CHECK: declare noundef i32 @putchar(i32 noundef) [[NOFREE_NOUNWIND]] ; CHECK-SYSTEMZ: declare noundef i32 @putchar(i32 noundef signext) declare i32 @putchar(i32) @@ -768,12 +810,14 @@ declare i32 @puts(i8*) ; CHECK: declare noundef i64 @pwrite(i32 noundef, i8* nocapture noundef readonly, i64 noundef, i64 noundef) [[NOFREE]] +; CHECK-SYSTEMZ: declare noundef i64 @pwrite(i32 noundef signext, i8* nocapture noundef readonly, i64 noundef, i64 noundef) declare i64 @pwrite(i32, i8*, i64, i64) ; CHECK: declare void @qsort(i8* noundef, i64 noundef, i64 noundef, i32 (i8*, i8*)* nocapture noundef) [[NOFREE]] declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*) ; CHECK: declare noundef i64 @read(i32 noundef, i8* nocapture noundef, i64 noundef) [[NOFREE]] +; CHECK-SYSTEMZ: declare noundef i64 @read(i32 noundef signext, i8* nocapture noundef, i64 noundef) declare i64 @read(i32, i8*, i64) ; CHECK: declare noundef i64 @readlink(i8* nocapture noundef readonly, i8* nocapture noundef, i64 noundef) [[NOFREE_NOUNWIND]] @@ -825,9 +869,11 @@ declare void @setbuf(%opaque*, i8*) ; CHECK: declare noundef i32 @setitimer(i32 noundef, %opaque* nocapture noundef readonly, %opaque* nocapture noundef) [[NOFREE_NOUNWIND_WILLRETURN]] +; CHECK-SYSTEMZ: declare noundef i32 @setitimer(i32 noundef signext, %opaque* nocapture noundef readonly, %opaque* nocapture noundef) declare i32 @setitimer(i32, %opaque*, %opaque*) ; CHECK: declare noundef i32 @setvbuf(%opaque* nocapture noundef, i8* noundef, i32 noundef, i64 noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @setvbuf(%opaque* nocapture noundef, i8* noundef, i32 noundef signext, i64 noundef) declare i32 @setvbuf(%opaque*, i8*, i32, i64) ; CHECK: declare double @sin(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] @@ -891,6 +937,7 @@ declare i8* @strcat(i8*, i8*) ; CHECK: declare i8* @strchr(i8*, i32) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]] +; CHECK-SYSTEMZ: declare i8* @strchr(i8*, i32 signext) declare i8* @strchr(i8*, i32) ; CHECK: declare i32 @strcmp(i8* nocapture, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]] @@ -933,6 +980,7 @@ declare i8* @strpbrk(i8*, i8*) ; CHECK: declare i8* @strrchr(i8*, i32) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]] +; CHECK-SYSTEMZ: declare i8* @strrchr(i8*, i32 signext) declare i8* @strrchr(i8*, i32) ; CHECK: declare i64 @strspn(i8* nocapture, i8* nocapture) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY]] @@ -954,18 +1002,22 @@ declare i8* @strtok_r(i8*, i8*, i8**) ; CHECK: declare i64 @strtol(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]] +; CHECK-SYSTEMZ: declare i64 @strtol(i8* readonly, i8** nocapture, i32 signext) declare i64 @strtol(i8*, i8**, i32) ; CHECK: declare x86_fp80 @strtold(i8* readonly, i8** nocapture) [[NOFREE_NOUNWIND_WILLRETURN]] declare x86_fp80 @strtold(i8*, i8**) ; CHECK: declare i64 @strtoll(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]] +; CHECK-SYSTEMZ: declare i64 @strtoll(i8* readonly, i8** nocapture, i32 signext) declare i64 @strtoll(i8*, i8**, i32) ; CHECK: declare i64 @strtoul(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]] +; CHECK-SYSTEMZ: declare i64 @strtoul(i8* readonly, i8** nocapture, i32 signext) declare i64 @strtoul(i8*, i8**, i32) ; CHECK: declare i64 @strtoull(i8* readonly, i8** nocapture, i32) [[NOFREE_NOUNWIND_WILLRETURN]] +; CHECK-SYSTEMZ: declare i64 @strtoull(i8* readonly, i8** nocapture, i32 signext) declare i64 @strtoull(i8*, i8**, i32) ; CHECK: declare i64 @strxfrm(i8* nocapture, i8* nocapture readonly, i64) [[NOFREE_NOUNWIND_WILLRETURN]] @@ -1002,6 +1054,7 @@ declare %opaque* @tmpfile64() ; CHECK: declare i32 @toascii(i32) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] +; CHECK-SYSTEMZ: declare i32 @toascii(i32 signext) declare i32 @toascii(i32) ; CHECK: declare double @trunc(double) [[NOFREE_NOUNWIND_WILLRETURN_WRITEONLY]] @@ -1017,6 +1070,7 @@ declare i32 @uname(%opaque*) ; CHECK: declare noundef i32 @ungetc(i32 noundef, %opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-SYSTEMZ: declare noundef i32 @ungetc(i32 noundef signext, %opaque* nocapture noundef) declare i32 @ungetc(i32, %opaque*) ; CHECK: declare noundef i32 @unlink(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]] @@ -1056,6 +1110,7 @@ declare i32 @vsscanf(i8*, i8*, %opaque*) ; CHECK: declare noundef i64 @write(i32 noundef, i8* nocapture noundef readonly, i64 noundef) [[NOFREE]] +; CHECK-SYSTEMZ: declare noundef i64 @write(i32 noundef signext, i8* nocapture noundef readonly, i64 noundef) declare i64 @write(i32, i8*, i64)