Skip to content

Commit 03ac08d

Browse files
[nfc][InstrProfTest]Un-parameterize test cases that doesn't use profile reader and writer (#73026)
Test fixture `MaybeSparseInstrProfTest` parameterize InstrProfWriter by whether output is sparse or not. This test fixture has 20 test cases, and 6 of them doesn't use profile reader and writer. Undo the parameterization for these test cases will reduce redundant tests. This is one clean-up PR. (A few more clean-ups to come soon, but they are not inter-dependent)
1 parent e746b56 commit 03ac08d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

llvm/unittests/ProfileData/InstrProfTest.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ static void addValueProfData(InstrProfRecord &Record) {
11061106
Record.addValueData(IPVK_IndirectCallTarget, 4, nullptr, 0, nullptr);
11071107
}
11081108

1109-
TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write) {
1109+
TEST(ValueProfileReadWriteTest, value_prof_data_read_write) {
11101110
InstrProfRecord SrcRecord({1ULL << 31, 2});
11111111
addValueProfData(SrcRecord);
11121112
std::unique_ptr<ValueProfData> VPData =
@@ -1171,8 +1171,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write) {
11711171
ASSERT_EQ(1800U, VD_3[1].Count);
11721172
}
11731173

1174-
TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write_mapping) {
1175-
1174+
TEST(ValueProfileReadWriteTest, symtab_mapping) {
11761175
NamedInstrProfRecord SrcRecord("caller", 0x1234, {1ULL << 31, 2});
11771176
addValueProfData(SrcRecord);
11781177
std::unique_ptr<ValueProfData> VPData =
@@ -1240,7 +1239,7 @@ TEST_P(MaybeSparseInstrProfTest, get_weighted_function_counts) {
12401239
}
12411240

12421241
// Testing symtab creator interface used by indexed profile reader.
1243-
TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_test) {
1242+
TEST(SymtabTest, instr_prof_symtab_test) {
12441243
std::vector<StringRef> FuncNames;
12451244
FuncNames.push_back("func1");
12461245
FuncNames.push_back("func2");
@@ -1296,13 +1295,13 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_test) {
12961295
}
12971296

12981297
// Test that we get an error when creating a bogus symtab.
1299-
TEST_P(MaybeSparseInstrProfTest, instr_prof_bogus_symtab_empty_func_name) {
1298+
TEST(SymtabTest, instr_prof_bogus_symtab_empty_func_name) {
13001299
InstrProfSymtab Symtab;
13011300
EXPECT_TRUE(ErrorEquals(instrprof_error::malformed, Symtab.addFuncName("")));
13021301
}
13031302

13041303
// Testing symtab creator interface used by value profile transformer.
1305-
TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) {
1304+
TEST(SymtabTest, instr_prof_symtab_module_test) {
13061305
LLVMContext Ctx;
13071306
std::unique_ptr<Module> M = std::make_unique<Module>("MyModule.cpp", Ctx);
13081307
FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx),
@@ -1346,7 +1345,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) {
13461345

13471346
// Testing symtab serialization and creator/deserialization interface
13481347
// used by coverage map reader, and raw profile reader.
1349-
TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) {
1348+
TEST(SymtabTest, instr_prof_symtab_compression_test) {
13501349
std::vector<std::string> FuncNames1;
13511350
std::vector<std::string> FuncNames2;
13521351
for (int I = 0; I < 3; I++) {

0 commit comments

Comments
 (0)