Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nfc][InstrProfTest]Un-parameterize test cases that doesn't use profile reader and writer #73026

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions llvm/unittests/ProfileData/InstrProfTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ static void addValueProfData(InstrProfRecord &Record) {
Record.addValueData(IPVK_IndirectCallTarget, 4, nullptr, 0, nullptr);
}

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

TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write_mapping) {

TEST(ValueProfileReadWriteTest, symtab_mapping) {
NamedInstrProfRecord SrcRecord("caller", 0x1234, {1ULL << 31, 2});
addValueProfData(SrcRecord);
std::unique_ptr<ValueProfData> VPData =
Expand Down Expand Up @@ -1240,7 +1239,7 @@ TEST_P(MaybeSparseInstrProfTest, get_weighted_function_counts) {
}

// Testing symtab creator interface used by indexed profile reader.
TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_test) {
TEST(SymtabTest, instr_prof_symtab_test) {
std::vector<StringRef> FuncNames;
FuncNames.push_back("func1");
FuncNames.push_back("func2");
Expand Down Expand Up @@ -1296,13 +1295,13 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_test) {
}

// Test that we get an error when creating a bogus symtab.
TEST_P(MaybeSparseInstrProfTest, instr_prof_bogus_symtab_empty_func_name) {
TEST(SymtabTest, instr_prof_bogus_symtab_empty_func_name) {
InstrProfSymtab Symtab;
EXPECT_TRUE(ErrorEquals(instrprof_error::malformed, Symtab.addFuncName("")));
}

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

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