diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -123,6 +123,7 @@ // 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 --- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll +++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll @@ -509,7 +509,9 @@ ; 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]]