Jlm
TypeMismatchTests.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2010 2011 2012 2014 Helge Bahmann <hcb@chaoticmind.net>
3  * Copyright 2014 2015 Nico Reißmann <nico.reissmann@gmail.com>
4  * See COPYING for terms of redistribution.
5  */
6 
7 #include <gtest/gtest.h>
8 
9 #include <jlm/rvsdg/graph.hpp>
11 #include <jlm/rvsdg/TestType.hpp>
12 
13 TEST(TypeMismatchTests, test_main)
14 {
15  using namespace jlm::rvsdg;
16 
17  Graph graph;
18 
20  auto value_type = TestType::createValueType();
21 
22  auto n1 = TestOperation::createNode(&graph.GetRootRegion(), {}, { type });
23 
24  // Act & Assert
25  EXPECT_THROW(
26  TestOperation::createNode(&graph.GetRootRegion(), { value_type }, { n1->output(0) }, {}),
28 }
TEST(TypeMismatchTests, test_main)
Region & GetRootRegion() const noexcept
Definition: graph.hpp:99
static SimpleNode * createNode(Region *region, const std::vector< Output * > &operands, std::vector< std::shared_ptr< const Type >> resultTypes)
static std::shared_ptr< const TestType > createStateType()
Definition: TestType.cpp:60
static std::shared_ptr< const TestType > createValueType()
Definition: TestType.cpp:67