Jlm
GetElementPtrTests.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2023 Nico Reißmann <nico.reissmann@gmail.com>
3  * See COPYING for terms of redistribution.
4  */
5 
6 #include <gtest/gtest.h>
7 
9 
10 TEST(GetElementPtrOperationTests, TestOperationEquality)
11 {
12  using namespace jlm::llvm;
13  using namespace jlm::rvsdg;
14 
15  auto arrayType = ArrayType::Create(BitType::Create(8), 11);
16 
17  auto structType1 = StructType::CreateLiteral({ BitType::Create(64), BitType::Create(64) }, false);
18  auto structType2 =
19  StructType::CreateIdentified("myStructType", { arrayType, BitType::Create(32) }, false);
20 
21  GetElementPtrOperation operation1(
23  structType1);
24  GetElementPtrOperation operation2(
26  structType2);
27 
28  EXPECT_NE(operation1, operation2);
29 }
TEST(GetElementPtrOperationTests, TestOperationEquality)
static std::shared_ptr< const ArrayType > Create(std::shared_ptr< const Type > type, size_t nelements)
Definition: types.hpp:98
static std::shared_ptr< const StructType > CreateIdentified(const std::string &name, std::vector< std::shared_ptr< const Type >> types, bool isPacked)
Definition: types.hpp:307
static std::shared_ptr< const StructType > CreateLiteral(std::vector< std::shared_ptr< const Type >> types, bool isPacked)
Definition: types.hpp:334
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
Definition: type.cpp:45
Global memory state passed between functions.