aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Support/ValueHandleTest.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
committerOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
commit35b4707edb32008b1a7976dcbf3920b1160fc1c6 (patch)
tree2cdabe223bfce83bd12e10dd557147a2f68c9bf8 /unittests/Support/ValueHandleTest.cpp
parentdfa78d19236fe2c33733c916f45d25ba46e0773f (diff)
downloadexternal_llvm-35b4707edb32008b1a7976dcbf3920b1160fc1c6.zip
external_llvm-35b4707edb32008b1a7976dcbf3920b1160fc1c6.tar.gz
external_llvm-35b4707edb32008b1a7976dcbf3920b1160fc1c6.tar.bz2
Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/ValueHandleTest.cpp')
-rw-r--r--unittests/Support/ValueHandleTest.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/unittests/Support/ValueHandleTest.cpp b/unittests/Support/ValueHandleTest.cpp
index 5e6cd61..c6b5356 100644
--- a/unittests/Support/ValueHandleTest.cpp
+++ b/unittests/Support/ValueHandleTest.cpp
@@ -26,8 +26,8 @@ protected:
std::auto_ptr<BitCastInst> BitcastV;
ValueHandle() :
- ConstantV(ConstantInt::get(Type::Int32Ty, 0)),
- BitcastV(new BitCastInst(ConstantV, Type::Int32Ty)) {
+ ConstantV(ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 0)),
+ BitcastV(new BitCastInst(ConstantV, Type::getInt32Ty(getGlobalContext()))) {
}
};
@@ -45,8 +45,8 @@ TEST_F(ValueHandle, WeakVH_BasicOperation) {
// Make sure I can call a method on the underlying Value. It
// doesn't matter which method.
- EXPECT_EQ(Type::Int32Ty, WVH->getType());
- EXPECT_EQ(Type::Int32Ty, (*WVH).getType());
+ EXPECT_EQ(Type::getInt32Ty(getGlobalContext()), WVH->getType());
+ EXPECT_EQ(Type::getInt32Ty(getGlobalContext()), (*WVH).getType());
}
TEST_F(ValueHandle, WeakVH_Comparisons) {
@@ -200,8 +200,8 @@ TEST_F(ValueHandle, CallbackVH_BasicOperation) {
// Make sure I can call a method on the underlying Value. It
// doesn't matter which method.
- EXPECT_EQ(Type::Int32Ty, CVH->getType());
- EXPECT_EQ(Type::Int32Ty, (*CVH).getType());
+ EXPECT_EQ(Type::getInt32Ty(getGlobalContext()), CVH->getType());
+ EXPECT_EQ(Type::getInt32Ty(getGlobalContext()), (*CVH).getType());
}
TEST_F(ValueHandle, CallbackVH_Comparisons) {
@@ -302,7 +302,7 @@ TEST_F(ValueHandle, CallbackVH_DeletionCanRAUW) {
private:
virtual void deleted() {
- getValPtr()->replaceAllUsesWith(Constant::getNullValue(Type::Int32Ty));
+ getValPtr()->replaceAllUsesWith(Constant::getNullValue(Type::getInt32Ty(getGlobalContext())));
setValPtr(NULL);
}
virtual void allUsesReplacedWith(Value *new_value) {
@@ -319,11 +319,11 @@ TEST_F(ValueHandle, CallbackVH_DeletionCanRAUW) {
RVH = BitcastV.get();
std::auto_ptr<BinaryOperator> BitcastUser(
BinaryOperator::CreateAdd(RVH,
- Constant::getNullValue(Type::Int32Ty)));
+ Constant::getNullValue(Type::getInt32Ty(getGlobalContext()))));
EXPECT_EQ(BitcastV.get(), BitcastUser->getOperand(0));
BitcastV.reset(); // Would crash without the ValueHandler.
- EXPECT_EQ(Constant::getNullValue(Type::Int32Ty), RVH.AURWArgument);
- EXPECT_EQ(Constant::getNullValue(Type::Int32Ty),
+ EXPECT_EQ(Constant::getNullValue(Type::getInt32Ty(getGlobalContext())), RVH.AURWArgument);
+ EXPECT_EQ(Constant::getNullValue(Type::getInt32Ty(getGlobalContext())),
BitcastUser->getOperand(0));
}