[llvm-commits] [llvm] r55228 - in /llvm/trunk: lib/VMCore/Verifier.cpp test/Verifier/2008-08-22-MemCpyAlignment.ll
Chris Lattner
sabre at nondot.org
Fri Aug 22 22:31:10 PDT 2008
Author: lattner
Date: Sat Aug 23 00:31:10 2008
New Revision: 55228
URL: http://llvm.org/viewvc/llvm-project?rev=55228&view=rev
Log:
Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.
Added:
llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=55228&r1=55227&r2=55228&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Sat Aug 23 00:31:10 2008
@@ -1273,6 +1273,16 @@
switch (ID) {
default:
break;
+ case Intrinsic::memcpy_i32:
+ case Intrinsic::memcpy_i64:
+ case Intrinsic::memmove_i32:
+ case Intrinsic::memmove_i64:
+ case Intrinsic::memset_i32:
+ case Intrinsic::memset_i64:
+ Assert1(isa<ConstantInt>(CI.getOperand(4)),
+ "alignment argument of memory intrinsics must be a constant int",
+ &CI);
+ break;
case Intrinsic::init_trampoline:
Assert1(isa<Function>(CI.getOperand(2)->stripPointerCasts()),
"llvm.init_trampoline parameter #2 must resolve to a function.",
Added: llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll?rev=55228&view=auto
==============================================================================
--- llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll (added)
+++ llvm/trunk/test/Verifier/2008-08-22-MemCpyAlignment.ll Sat Aug 23 00:31:10 2008
@@ -0,0 +1,11 @@
+; RUN: not llvm-as -f %s -o /dev/null |& grep {alignment argument of memory intrinsics must be a constant int}
+; PR2318
+
+define void @x(i8* %a, i8* %src, i64 %len, i32 %align) nounwind {
+entry:
+ tail call void @llvm.memcpy.i64( i8* %a, i8* %src, i64 %len, i32 %align) nounwind
+ ret void
+}
+
+declare void @llvm.memcpy.i64( i8* %a, i8* %src, i64 %len, i32)
+
More information about the llvm-commits
mailing list