15TEST(EndlessLoopTests, test)
17 auto setup = [](llvm::LLVMContext & ctx)
19 using namespace ::
llvm;
21 std::unique_ptr<Module> module(
new Module(
"module", ctx));
23 auto int64 = Type::getIntNTy(ctx, 64);
25 auto fcttype = FunctionType::get(int64, {},
false);
26 auto fct = Function::Create(fcttype, GlobalValue::ExternalLinkage,
"f", module.get());
28 auto bb1 = BasicBlock::Create(ctx,
"", fct);
29 auto bb2 = BasicBlock::Create(ctx,
"", fct);
31 IRBuilder<> builder(bb1);
32 builder.CreateBr(bb2);
33 builder.SetInsertPoint(bb2);
34 builder.CreateBr(bb2);
39 llvm::LLVMContext ctx;
40 auto llvmModule = setup(ctx);
41 llvmModule->print(llvm::errs(),
nullptr);
44 print(*ipgModule, stdout);