diff --git a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp --- a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp +++ b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp @@ -25,7 +25,7 @@ using namespace mlir; -// Load the SPIRV dialect +/// Load the SPIRV dialect. static DialectRegistration SPIRVRegistration; using ::testing::StrEq; @@ -159,7 +159,7 @@ addHeader(); binary.push_back((2u << 16) | static_cast(spirv::Opcode::OpTypeVoid)); - // Missing word for type + // Missing word for type . ASSERT_FALSE(deserialize()); expectDiagnostic("insufficient words for the last instruction"); @@ -248,7 +248,7 @@ auto voidType = addVoidType(); auto fnType = addFunctionType(voidType, {}); addFunction(voidType, fnType); - // Missing OpFunctionEnd + // Missing OpFunctionEnd. ASSERT_FALSE(deserialize()); expectDiagnostic("expected OpFunctionEnd instruction"); @@ -260,7 +260,7 @@ auto i32Type = addIntType(32); auto fnType = addFunctionType(voidType, {i32Type}); addFunction(voidType, fnType); - // Missing OpFunctionParameter + // Missing OpFunctionParameter. ASSERT_FALSE(deserialize()); expectDiagnostic("expected OpFunctionParameter instruction"); @@ -271,7 +271,7 @@ auto voidType = addVoidType(); auto fnType = addFunctionType(voidType, {}); addFunction(voidType, fnType); - // Missing OpLabel + // Missing OpLabel. addReturn(); addFunctionEnd(); diff --git a/mlir/unittests/SDBM/SDBMTest.cpp b/mlir/unittests/SDBM/SDBMTest.cpp --- a/mlir/unittests/SDBM/SDBMTest.cpp +++ b/mlir/unittests/SDBM/SDBMTest.cpp @@ -17,7 +17,7 @@ using namespace mlir; -// Load the SDBM dialect +/// Load the SDBM dialect. static DialectRegistration SDBMRegistration; static MLIRContext *ctx() { diff --git a/mlir/unittests/TableGen/EnumsGenTest.cpp b/mlir/unittests/TableGen/EnumsGenTest.cpp --- a/mlir/unittests/TableGen/EnumsGenTest.cpp +++ b/mlir/unittests/TableGen/EnumsGenTest.cpp @@ -13,12 +13,11 @@ #include "gmock/gmock.h" #include -// Pull in generated enum utility declarations +/// Pull in generated enum utility declarations and definitions. #include "EnumsGenTest.h.inc" -// And definitions #include "EnumsGenTest.cpp.inc" -// Test namespaces and enum class/utility names +/// Test namespaces and enum class/utility names. using Outer::Inner::ConvertToEnum; using Outer::Inner::ConvertToString; using Outer::Inner::StrEnum; diff --git a/mlir/unittests/TableGen/FormatTest.cpp b/mlir/unittests/TableGen/FormatTest.cpp --- a/mlir/unittests/TableGen/FormatTest.cpp +++ b/mlir/unittests/TableGen/FormatTest.cpp @@ -19,14 +19,14 @@ EXPECT_TRUE(result.empty()); } -// Allow extra unused positional parameters +/// Allow extra unused positional parameters. TEST(FormatTest, EmptyFmtStrExtraParams) { FmtContext ctx; std::string result = std::string(tgfmt("", &ctx, "a", "b", "c")); EXPECT_TRUE(result.empty()); } -// Allow unused placeholder substitution in context +/// Allow unused placeholder substitution in context. TEST(FormatTest, EmptyFmtStrPopulatedCtx) { FmtContext ctx; ctx.withBuilder("builder"); @@ -40,21 +40,21 @@ EXPECT_THAT(result, StrEq("void foo {}")); } -// Print single dollar literally +/// Print single dollar literally. TEST(FormatTest, AdjacentDollar) { FmtContext ctx; std::string result = std::string(tgfmt("$", &ctx)); EXPECT_THAT(result, StrEq("$")); } -// Print dangling dollar literally +/// Print dangling dollar literally. TEST(FormatTest, DanglingDollar) { FmtContext ctx; std::string result = std::string(tgfmt("foo bar baz$", &ctx)); EXPECT_THAT(result, StrEq("foo bar baz$")); } -// Allow escape dollars with '$$' +/// Allow escape dollars with '$$'. TEST(FormatTest, EscapeDollars) { FmtContext ctx; std::string result = @@ -72,14 +72,14 @@ EXPECT_THAT(result, StrEq("a b 43 d")); } -// Output the placeholder if missing substitution +/// Output the placeholder if missing substitution. TEST(FormatTest, PositionalFmtStrMissingParams) { FmtContext ctx; std::string result = std::string(tgfmt("$0 %1 $2", &ctx)); EXPECT_THAT(result, StrEq("$0 %1 $2")); } -// Allow flexible reference of positional parameters +/// Allow flexible reference of positional parameters. TEST(FormatTest, PositionalFmtStrFlexibleRef) { FmtContext ctx; std::string result = std::string(tgfmt("$2 $0 $2", &ctx, "a", "b", "c")); @@ -122,7 +122,7 @@ EXPECT_THAT(result, StrEq("$_op")); } -// Test commonly used delimiters in C++ +/// Test commonly used delimiters in C++. TEST(FormatTest, PlaceHolderFmtStrDelimiter) { FmtContext ctx; ctx.addSubst("m", ""); @@ -130,7 +130,7 @@ EXPECT_THAT(result, StrEq("{([])}|")); } -// Test allowed characters in placeholder symbol +/// Test allowed characters in placeholder symbol. TEST(FormatTest, CustomPlaceHolderFmtStrPlaceHolderChars) { FmtContext ctx; ctx.addSubst("m", "0 "); diff --git a/mlir/unittests/TableGen/StructsGenTest.cpp b/mlir/unittests/TableGen/StructsGenTest.cpp --- a/mlir/unittests/TableGen/StructsGenTest.cpp +++ b/mlir/unittests/TableGen/StructsGenTest.cpp @@ -17,12 +17,12 @@ namespace mlir { -// Pull in generated enum utility declarations +/// Pull in generated enum utility declarations and definitions. #include "StructAttrGenTest.h.inc" -// And definitions #include "StructAttrGenTest.cpp.inc" -// Helper that returns an example test::TestStruct for testing its -// implementation. + +/// Helper that returns an example test::TestStruct for testing its +/// implementation. static test::TestStruct getTestStruct(mlir::MLIRContext *context) { auto integerType = mlir::IntegerType::get(32, context); auto integerAttr = mlir::IntegerAttr::get(integerType, 127); @@ -39,16 +39,16 @@ optionalAttr, context); } -// Validates that test::TestStruct::classof correctly identifies a valid -// test::TestStruct. +/// Validates that test::TestStruct::classof correctly identifies a valid +/// test::TestStruct. TEST(StructsGenTest, ClassofTrue) { mlir::MLIRContext context; auto structAttr = getTestStruct(&context); ASSERT_TRUE(test::TestStruct::classof(structAttr)); } -// Validates that test::TestStruct::classof fails when an extra attribute is in -// the class. +/// Validates that test::TestStruct::classof fails when an extra attribute is in +/// the class. TEST(StructsGenTest, ClassofExtraFalse) { mlir::MLIRContext context; mlir::DictionaryAttr structAttr = getTestStruct(&context); @@ -69,8 +69,8 @@ ASSERT_FALSE(test::TestStruct::classof(badDictionary)); } -// Validates that test::TestStruct::classof fails when a NamedAttribute has an -// incorrect name. +/// Validates that test::TestStruct::classof fails when a NamedAttribute has an +/// incorrect name. TEST(StructsGenTest, ClassofBadNameFalse) { mlir::MLIRContext context; mlir::DictionaryAttr structAttr = getTestStruct(&context); @@ -90,8 +90,8 @@ ASSERT_FALSE(test::TestStruct::classof(badDictionary)); } -// Validates that test::TestStruct::classof fails when a NamedAttribute has an -// incorrect type. +/// Validates that test::TestStruct::classof fails when a NamedAttribute has an +/// incorrect type. TEST(StructsGenTest, ClassofBadTypeFalse) { mlir::MLIRContext context; mlir::DictionaryAttr structAttr = getTestStruct(&context); @@ -115,8 +115,8 @@ ASSERT_FALSE(test::TestStruct::classof(badDictionary)); } -// Validates that test::TestStruct::classof fails when a NamedAttribute is -// missing. +/// Validates that test::TestStruct::classof fails when a NamedAttribute is +/// missing. TEST(StructsGenTest, ClassofMissingFalse) { mlir::MLIRContext context; mlir::DictionaryAttr structAttr = getTestStruct(&context); @@ -132,7 +132,7 @@ ASSERT_FALSE(test::TestStruct::classof(badDictionary)); } -// Validate the accessor for the FloatAttr value. +/// Validate the accessor for the FloatAttr value. TEST(StructsGenTest, GetFloat) { mlir::MLIRContext context; auto structAttr = getTestStruct(&context); @@ -140,7 +140,7 @@ EXPECT_EQ(returnedAttr.getValueAsDouble(), 0.25); } -// Validate the accessor for the IntegerAttr value. +/// Validate the accessor for the IntegerAttr value. TEST(StructsGenTest, GetInteger) { mlir::MLIRContext context; auto structAttr = getTestStruct(&context); @@ -148,7 +148,7 @@ EXPECT_EQ(returnedAttr.getInt(), 127); } -// Validate the accessor for the ElementsAttr value. +/// Validate the accessor for the ElementsAttr value. TEST(StructsGenTest, GetElements) { mlir::MLIRContext context; auto structAttr = getTestStruct(&context);