summaryrefslogtreecommitdiffstats
path: root/unittests/VMCore/InstructionsTest.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-05-02 19:34:44 +0000
committerdim <dim@FreeBSD.org>2011-05-02 19:34:44 +0000
commit2b066988909948dc3d53d01760bc2d71d32f3feb (patch)
treefc5f365fb9035b2d0c622bbf06c9bbe8627d7279 /unittests/VMCore/InstructionsTest.cpp
parentc80ac9d286b8fcc6d1ee5d76048134cf80aa9edc (diff)
downloadFreeBSD-src-2b066988909948dc3d53d01760bc2d71d32f3feb.zip
FreeBSD-src-2b066988909948dc3d53d01760bc2d71d32f3feb.tar.gz
Vendor import of llvm trunk r130700:
http://llvm.org/svn/llvm-project/llvm/trunk@130700
Diffstat (limited to 'unittests/VMCore/InstructionsTest.cpp')
-rw-r--r--unittests/VMCore/InstructionsTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/unittests/VMCore/InstructionsTest.cpp b/unittests/VMCore/InstructionsTest.cpp
index 1d1127d..8edcce4 100644
--- a/unittests/VMCore/InstructionsTest.cpp
+++ b/unittests/VMCore/InstructionsTest.cpp
@@ -9,6 +9,7 @@
#include "llvm/Instructions.h"
#include "llvm/BasicBlock.h"
+#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/LLVMContext.h"
#include "llvm/ADT/STLExtras.h"
@@ -107,5 +108,18 @@ TEST(InstructionsTest, BranchInst) {
delete bb1;
}
+TEST(InstructionsTest, CastInst) {
+ LLVMContext &C(getGlobalContext());
+
+ const Type* Int8Ty = Type::getInt8Ty(C);
+ const Type* Int64Ty = Type::getInt64Ty(C);
+ const Type* V8x8Ty = VectorType::get(Int8Ty, 8);
+ const Type* X86MMXTy = Type::getX86_MMXTy(C);
+
+ EXPECT_TRUE(CastInst::isCastable(V8x8Ty, X86MMXTy));
+ EXPECT_TRUE(CastInst::isCastable(X86MMXTy, V8x8Ty));
+ EXPECT_FALSE(CastInst::isCastable(Int64Ty, X86MMXTy));
+}
+
} // end anonymous namespace
} // end namespace llvm
OpenPOWER on IntegriCloud