Jlm
Loading...
Searching...
No Matches
jlm
llvm
ir
CfgNodeTests.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2020 Nico Reißmann <nico.reissmann@gmail.com>
3
* See COPYING for terms of redistribution.
4
*/
5
6
#include <gtest/gtest.h>
7
8
#include <
jlm/llvm/ir/cfg.hpp
>
9
#include <
jlm/llvm/ir/ipgraph-module.hpp
>
10
#include <
jlm/llvm/ir/print.hpp
>
11
12
TEST
(ControlFlowGraphNodeTests, test_divert_inedges)
13
{
14
using namespace
jlm::llvm
;
15
16
// Arrange
17
InterProceduralGraphModule
im(
jlm::util::FilePath
(
""
),
""
,
""
);
18
19
ControlFlowGraph
cfg(im);
20
21
auto
bb0 = BasicBlock::create(cfg);
22
23
cfg.
exit
()->
divert_inedges
(bb0);
24
bb0->add_outedge(bb0);
25
bb0->add_outedge(cfg.
exit
());
26
27
std::cout << ControlFlowGraph::ToAscii(cfg) << std::flush;
28
29
/* verify inedge diversion */
30
31
bb0->divert_inedges(bb0);
32
}
TEST
TEST(ControlFlowGraphNodeTests, test_divert_inedges)
Definition
CfgNodeTests.cpp:12
cfg.hpp
jlm::llvm::ControlFlowGraphNode::divert_inedges
void divert_inedges(llvm::ControlFlowGraphNode *new_successor)
Definition
cfg-node.hpp:171
jlm::llvm::ControlFlowGraph
Definition
cfg.hpp:159
jlm::llvm::ControlFlowGraph::exit
ExitNode * exit() const noexcept
Definition
cfg.hpp:212
jlm::llvm::InterProceduralGraphModule
Definition
ipgraph-module.hpp:55
jlm::util::FilePath
Definition
file.hpp:19
ipgraph-module.hpp
jlm::llvm
Global memory state passed between functions.
Definition
IpGraphToLlvmConverter.cpp:40
print.hpp
Generated by
1.9.8