20TEST(PtrCmpOperationTests, testNormalizeNullPointerComparison)
26 auto i32Type = BitType::Create(32);
27 auto functionType = FunctionType::Create({}, { pointerType });
41 auto deltaNode = DeltaNode::Create(
42 &graph.GetRootRegion(),
45 auto & deltaOutput = deltaNode->finalize(ptrNullDeltaNode.output(0));
47 auto lambdaNode = LambdaNode::Create(
48 graph.GetRootRegion(),
56 auto lambdaOutput = lambdaNode->finalize({ ptrNullLambdaNode.output(0) });
58 auto & fnToPtrNode = CreateOpNode<FunctionToPointerOperation>({ lambdaOutput }, functionType);
68 *cPtrNullNode.output(0));
73 *cPtrNullNode.output(0));
82 *fnToPtrNode.output(0),
83 *cPtrNullNode.output(0));
85 auto & x1 = GraphExport::Create(*ptrCmpNode1.output(0),
"x1");
86 auto & x2 = GraphExport::Create(*ptrCmpNode2.output(0),
"x2");
87 auto & x3 = GraphExport::Create(*ptrCmpNode3.output(0),
"x3");
88 auto & x4 = GraphExport::Create(*ptrCmpNode4.output(0),
"x4");
89 auto & x5 = GraphExport::Create(*ptrCmpNode5.output(0),
"x5");
100 auto [constantNode, constantOperation] =
102 EXPECT_NE(constantOperation,
nullptr);
103 EXPECT_EQ(constantOperation->Representation().nbits(), 1u);
104 EXPECT_EQ(constantOperation->Representation().to_uint(), 0u);
108 auto [constantNode, constantOperation] =
110 EXPECT_NE(constantOperation,
nullptr);
111 EXPECT_EQ(constantOperation->Representation().nbits(), 1u);
112 EXPECT_EQ(constantOperation->Representation().to_uint(), 1u);
116 auto [constantNode, constantOperation] =
118 EXPECT_NE(constantOperation,
nullptr);
119 EXPECT_EQ(constantOperation->Representation().nbits(), 1u);
120 EXPECT_EQ(constantOperation->Representation().to_uint(), 1u);
124 auto [constantNode, constantOperation] =
126 EXPECT_NE(constantOperation,
nullptr);
127 EXPECT_EQ(constantOperation->Representation().nbits(), 1u);
128 EXPECT_EQ(constantOperation->Representation().to_uint(), 1u);
132 auto [constantNode, constantOperation] =
134 EXPECT_NE(constantOperation,
nullptr);
135 EXPECT_EQ(constantOperation->Representation().nbits(), 1u);
136 EXPECT_EQ(constantOperation->Representation().to_uint(), 1u);
static std::unique_ptr< LlvmDeltaOperation > Create(std::shared_ptr< const rvsdg::Type > type, const std::string &name, const Linkage &linkage, std::string section, bool constant, const size_t alignment)
static LlvmGraphImport & create(rvsdg::Graph &graph, std::shared_ptr< const rvsdg::Type > valueType, std::shared_ptr< const rvsdg::Type > importedType, std::string name, Linkage linkage, CallingConvention callingConvention, const bool isConstant, const size_t alignment)
static std::unique_ptr< LlvmLambdaOperation > Create(std::shared_ptr< const jlm::rvsdg::FunctionType > type, std::string name, const jlm::llvm::Linkage &linkage, jlm::llvm::CallingConvention callingConvention, jlm::llvm::AttributeSet attributes)