Jlm
Loading...
Searching...
No Matches
jlm
llvm
ir
CfgTests.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
(ControLFlowGraphTests, test_remove_node)
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
bb0->add_outedge(bb0);
23
bb0->add_outedge(cfg.
exit
());
24
25
std::cout << ControlFlowGraph::ToAscii(cfg) << std::flush;
26
27
// Act
28
cfg.
remove_node
(bb0);
29
30
// Assert
31
EXPECT_EQ(cfg.
nnodes
(), 0u);
32
}
TEST
TEST(ControLFlowGraphTests, test_remove_node)
Definition
CfgTests.cpp:12
cfg.hpp
jlm::llvm::ControlFlowGraph
Definition
cfg.hpp:159
jlm::llvm::ControlFlowGraph::exit
ExitNode * exit() const noexcept
Definition
cfg.hpp:212
jlm::llvm::ControlFlowGraph::remove_node
static ControlFlowGraph::iterator remove_node(ControlFlowGraph::iterator &it)
Definition
cfg.cpp:36
jlm::llvm::ControlFlowGraph::nnodes
size_t nnodes() const noexcept
Definition
cfg.hpp:241
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