Jlm
Loading...
Searching...
No Matches
ExportTests.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2021 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/rvsdg/view.hpp>
9
15
16TEST(ExportTests, test)
17{
18 using namespace jlm::llvm;
19
21 auto ft = jlm::rvsdg::FunctionType::Create({ vt }, { vt });
22
24
25 auto d = DataNode::Create(im.ipgraph(), "d", vt, Linkage::externalLinkage, "", false, 4);
26 auto f = FunctionNode::create(im.ipgraph(), "f", ft, Linkage::externalLinkage);
27
28 im.create_global_value(d);
29 im.create_variable(f);
30
32 auto rvsdgModule = ConvertInterProceduralGraphModule(im, statisticsCollector);
33
34 jlm::rvsdg::view(rvsdgModule->Rvsdg(), stdout);
35
36 // We should have no exports in the RVSDG. The data and function
37 // node should be converted to RVSDG imports as they do not have
38 // a body, i.e., either a CFG or a initialization.
39 EXPECT_EQ(rvsdgModule->Rvsdg().GetRootRegion().nresults(), 0u);
40}
static jlm::util::StatisticsCollector statisticsCollector
TEST(ExportTests, test)
static const auto vt
Definition PullTests.cpp:16
static std::shared_ptr< const FunctionType > Create(std::vector< std::shared_ptr< const jlm::rvsdg::Type > > argumentTypes, std::vector< std::shared_ptr< const jlm::rvsdg::Type > > resultTypes)
static std::shared_ptr< const TestType > createValueType()
Definition TestType.cpp:67
Global memory state passed between functions.
std::string view(const rvsdg::Region *region)
Definition view.cpp:142