Files
clang-p2996/mlir/unittests/IR/AffineMapTest.cpp
Uday Bondhugula fe8a62c463 [MLIR] Fix crash in AffineMap::replace for zero result maps (#80930)
Fix obvious bug in AffineMap::replace for the case of zero result maps.
Extend/complete inferExprsFromList to work with empty expression lists.
2024-02-08 19:16:29 +05:30

24 lines
767 B
C++

//===- AffineMapTest.cpp - unit tests for affine map API ------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Builders.h"
#include "gtest/gtest.h"
using namespace mlir;
// Test AffineMap replace API for the zero result case.
TEST(AffineMapTest, inferMapFromAffineExprs) {
MLIRContext ctx;
OpBuilder b(&ctx);
AffineMap map = b.getEmptyAffineMap();
DenseMap<AffineExpr, AffineExpr> replacements;
map.replace(replacements);
EXPECT_EQ(map, map);
}