From fe44c7362b331df8d82e665ee418b191720bfedd Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Tue, 30 May 2023 10:43:30 -0500 Subject: [PATCH] Ignore __tvm_main__ in unit test --- tests/cpp/c_codegen_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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())); }