mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
Fix & re-enable test that intermittently failed in debug mode.
The Value class and derivates will have uninitialized member variables if not created via operator new. llvm-svn: 355590
This commit is contained in:
parent
9ade843ccb
commit
cfd3255251
@ -556,20 +556,21 @@ TEST(ConstantsTest, DontFoldFunctionPtrIfNoModule) {
|
||||
ASSERT_FALSE(foldFuncPtrAndConstToNull(Context, nullptr, 2, 4));
|
||||
}
|
||||
|
||||
TEST(ConstantsTest, DISABLED_FoldGlobalVariablePtr) {
|
||||
TEST(ConstantsTest, FoldGlobalVariablePtr) {
|
||||
LLVMContext Context;
|
||||
|
||||
|
||||
IntegerType *IntType(Type::getInt32Ty(Context));
|
||||
|
||||
GlobalVariable Global(IntType, true, GlobalValue::ExternalLinkage);
|
||||
std::unique_ptr<GlobalVariable> Global(
|
||||
new GlobalVariable(IntType, true, GlobalValue::ExternalLinkage));
|
||||
|
||||
Global.setAlignment(4);
|
||||
Global->setAlignment(4);
|
||||
|
||||
ConstantInt *TheConstant(ConstantInt::get(IntType, 2));
|
||||
|
||||
Constant *TheConstantExpr(
|
||||
ConstantExpr::getPtrToInt(&Global, IntType));
|
||||
ConstantExpr::getPtrToInt(Global.get(), IntType));
|
||||
|
||||
ASSERT_TRUE(ConstantExpr::get( \
|
||||
Instruction::And, TheConstantExpr, TheConstant)->isNullValue());
|
||||
|
Loading…
Reference in New Issue
Block a user