summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/Utils/BuildLibCalls.cpp4
-rw-r--r--llvm/test/Transforms/InstCombine/unlocked-stdio.ll2
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index bf912b078f6..5f5c4150d3b 100644
--- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -1166,8 +1166,8 @@ Value *llvm::emitFGetSUnlocked(Value *Str, Value *Size, Value *File,
Module *M = B.GetInsertBlock()->getModule();
Constant *F =
- M->getOrInsertFunction("fgets_unlocked", B.getInt32Ty(), B.getInt8PtrTy(),
- B.getInt32Ty(), File->getType());
+ M->getOrInsertFunction("fgets_unlocked", B.getInt8PtrTy(),
+ B.getInt8PtrTy(), B.getInt32Ty(), File->getType());
inferLibFuncAttributes(*M->getFunction("fgets_unlocked"), *TLI);
CallInst *CI =
B.CreateCall(F, {castToCStr(Str, B), Size, File}, "fgets_unlocked");
diff --git a/llvm/test/Transforms/InstCombine/unlocked-stdio.ll b/llvm/test/Transforms/InstCombine/unlocked-stdio.ll
index fa5a9fa6d96..77eb9188138 100644
--- a/llvm/test/Transforms/InstCombine/unlocked-stdio.ll
+++ b/llvm/test/Transforms/InstCombine/unlocked-stdio.ll
@@ -100,7 +100,7 @@ define internal void @fgets_test() {
; CHECK-NEXT: [[BUF:%.*]] = alloca [10 x i8], align 1
; CHECK-NEXT: [[CALL:%.*]] = call %struct._IO_FILE* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
; CHECK-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [10 x i8], [10 x i8]* [[BUF]], i64 0, i64 0
-; CHECK-NEXT: [[FGETS_UNLOCKED:%.*]] = call i32 @fgets_unlocked(i8* nonnull [[ARRAYDECAY]], i32 10, %struct._IO_FILE* [[CALL]])
+; CHECK-NEXT: [[FGETS_UNLOCKED:%.*]] = call i8* @fgets_unlocked(i8* nonnull [[ARRAYDECAY]], i32 10, %struct._IO_FILE* [[CALL]])
; CHECK-NEXT: ret void
;
%buf = alloca [10 x i8], align 1
OpenPOWER on IntegriCloud