diff --git a/tests/cpp/c_codegen_test.cc b/tests/cpp/c_codegen_test.cc index bceac172e8649..a01921239a9f4 100644 --- a/tests/cpp/c_codegen_test.cc +++ b/tests/cpp/c_codegen_test.cc @@ -121,5 +121,11 @@ TEST(CCodegen, FunctionOrder) { auto module = build(inputs, Target()); Array func_array = module->GetFunction("get_func_names", false)(); std::vector functions{func_array.begin(), func_array.end()}; + // The entry point is handled separately from the other functions. + functions.erase(std::remove_if(functions.begin(), functions.end(), + [](const std::string& name) { + return name == tvm::runtime::symbol::tvm_module_main; + }), + functions.end()); EXPECT_TRUE(std::is_sorted(functions.begin(), functions.end())); }