diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 8eb1a4929269d5..cfd9aff505620d 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -123,6 +123,7 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, // Set IO unlocked variants as unavailable // Set them as available per system below + TLI.setUnavailable(LibFunc_getc_unlocked); TLI.setUnavailable(LibFunc_getchar_unlocked); TLI.setUnavailable(LibFunc_putc_unlocked); TLI.setUnavailable(LibFunc_putchar_unlocked); diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll index 31656e2bb2942d..80fb3ecf1bd6b7 100644 --- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll +++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll @@ -509,7 +509,9 @@ declare i64 @fwrite(i8*, i64, i64, %opaque*) ; CHECK: declare noundef i32 @getc(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] declare i32 @getc(%opaque*) -; CHECK: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-KNOWN: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]] +; CHECK-UNKNOWN: declare i32 @getc_unlocked(%opaque*) +; CHECK-UNKNOWN-NOT: #{{.*}} declare i32 @getc_unlocked(%opaque*) ; CHECK: declare noundef i32 @getchar() [[NOFREE_NOUNWIND]]