diff --git a/mlir/unittests/TableGen/OpBuildGen.cpp b/mlir/unittests/TableGen/OpBuildGen.cpp --- a/mlir/unittests/TableGen/OpBuildGen.cpp +++ b/mlir/unittests/TableGen/OpBuildGen.cpp @@ -1,4 +1,5 @@ //===- OpBuildGen.cpp - TableGen OpBuildGen Tests -------------------------===// +//===- OpBuildGen.cpp - TableGen OpBuildGen Tests -------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -27,7 +28,7 @@ static MLIRContext &getContext() { static MLIRContext ctx; - ctx.getOrLoadDialect(); + ctx.getOrLoadDialect(); return ctx; } /// Test fixture for providing basic utilities for testing. @@ -36,8 +37,8 @@ OpBuildGenTest() : ctx(getContext()), builder(&ctx), loc(builder.getUnknownLoc()), i32Ty(builder.getI32Type()), f32Ty(builder.getF32Type()), - cstI32(builder.create(loc, i32Ty)), - cstF32(builder.create(loc, f32Ty)), + cstI32(builder.create(loc, i32Ty)), + cstF32(builder.create(loc, f32Ty)), noAttrs(), attrStorage{builder.getNamedAttr("attr0", builder.getBoolAttr(true)), builder.getNamedAttr( @@ -96,8 +97,8 @@ Location loc; Type i32Ty; Type f32Ty; - TableGenConstant cstI32; - TableGenConstant cstF32; + test::TableGenConstant cstI32; + test::TableGenConstant cstF32; ArrayRef noAttrs; std::vector attrStorage; @@ -107,21 +108,21 @@ /// Test basic build methods. TEST_F(OpBuildGenTest, BasicBuildMethods) { // Test separate args, separate results build method. - auto op = builder.create(loc, i32Ty, cstI32); + auto op = builder.create(loc, i32Ty, cstI32); verifyOp(op, {i32Ty}, {cstI32}, noAttrs); // Test separate args, collective results build method. - op = builder.create(loc, TypeRange{i32Ty}, cstI32); + op = builder.create(loc, TypeRange{i32Ty}, cstI32); verifyOp(op, {i32Ty}, {cstI32}, noAttrs); // Test collective args, collective params build method. - op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32}); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}); verifyOp(op, {i32Ty}, {cstI32}, noAttrs); // Test collective args, collective results, non-empty attributes - op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32}, attrs); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}, attrs); verifyOp(op, {i32Ty}, {cstI32}, attrs); } @@ -138,25 +139,25 @@ /// variadic result. TEST_F(OpBuildGenTest, BuildMethodsSingleVariadicArgAndResult) { // Test collective args, collective results method, building a unary op. - auto op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32}); + auto op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32}, noAttrs); // Test collective args, collective results method, building a unary op with // named attributes. - op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32}, attrs); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}, attrs); verifyOp(std::move(op), {i32Ty}, {cstI32}, attrs); // Test collective args, collective results method, building a binary op. - op = builder.create(loc, TypeRange{i32Ty, f32Ty}, - ValueRange{cstI32, cstF32}); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32, cstF32}); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32, cstF32}, noAttrs); // Test collective args, collective results method, building a binary op with // named attributes. - op = builder.create(loc, TypeRange{i32Ty, f32Ty}, - ValueRange{cstI32, cstF32}, attrs); + op = builder.create( + loc, TypeRange{i32Ty, f32Ty}, ValueRange{cstI32, cstF32}, attrs); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32, cstF32}, attrs); } @@ -164,22 +165,23 @@ /// result. TEST_F(OpBuildGenTest, BuildMethodsSingleVariadicArgNonVariadicResults) { // Test separate arg, separate param build method. - auto op = builder.create(loc, i32Ty, ValueRange{cstI32}); + auto op = + builder.create(loc, i32Ty, ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32}, noAttrs); // Test collective params build method, no attributes. - op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32}); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32}, noAttrs); // Test collective params build method no attributes, 2 inputs. - op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32, cstF32}); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32, cstF32}); verifyOp(std::move(op), {i32Ty}, {cstI32, cstF32}, noAttrs); // Test collective params build method, non-empty attributes. - op = builder.create(loc, TypeRange{i32Ty}, - ValueRange{cstI32, cstF32}, attrs); + op = builder.create( + loc, TypeRange{i32Ty}, ValueRange{cstI32, cstF32}, attrs); verifyOp(std::move(op), {i32Ty}, {cstI32, cstF32}, attrs); } @@ -188,18 +190,18 @@ TEST_F(OpBuildGenTest, BuildMethodsSingleVariadicArgAndMultipleVariadicResults) { // Test separate arg, separate param build method. - auto op = builder.create( + auto op = builder.create( loc, TypeRange{i32Ty}, TypeRange{f32Ty}, ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32}, noAttrs); // Test collective params build method, no attributes. - op = builder.create(loc, TypeRange{i32Ty, f32Ty}, - ValueRange{cstI32}); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32}, noAttrs); // Test collective params build method, with attributes. - op = builder.create(loc, TypeRange{i32Ty, f32Ty}, - ValueRange{cstI32}, attrs); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32}, attrs); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32}, attrs); } @@ -209,13 +211,13 @@ // InferOpTypeInterface interface. For such ops, the ODS framework generates // build methods with no result types as they are inferred from the input types. TEST_F(OpBuildGenTest, BuildMethodsSameOperandsAndResultTypeSuppression) { - testSingleVariadicInputInferredType(); + testSingleVariadicInputInferredType(); } TEST_F( OpBuildGenTest, BuildMethodsSameOperandsAndResultTypeAndInferOpTypeInterfaceSuppression) { - testSingleVariadicInputInferredType(); + testSingleVariadicInputInferredType(); } } // namespace mlir