Value *Src = EmitScalarExpr(E->getArg(1));
Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size);
Builder.CreateMemCpy(Dest, Src, SizeVal, 1, false);
- return RValue::get(0);
+ return RValue::get(Dest);
}
case Builtin::BI__builtin_objc_memmove_collectable: {
Value *Src = EmitScalarExpr(E->getArg(1));
Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size);
Builder.CreateMemMove(Dest, Src, SizeVal, 1, false);
- return RValue::get(0);
+ return RValue::get(Dest);
}
case Builtin::BImemmove:
Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size);
Builder.CreateMemSet(Address, ByteVal, SizeVal, 1, false);
- return RValue::get(0);
+ return RValue::get(Address);
}
case Builtin::BI__builtin_dwarf_cfa: {
// The offset in bytes from the first argument to the CFA.
void test5(char *P, char *Q) {
__builtin___memmove_chk(P, Q, 128, 128);
}
+
+// CHECK: @test6
+// CHECK: call void @llvm.memcpy
+int test6(char *X) {
+ return __builtin___memcpy_chk(X, X, 42, 42) != 0;
+}