mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 12:10:59 +00:00
[cxx/system]: fix init_priority ordering on RISCV
* C++ init_priority attributes work now on RISCV * Add debug output for init_array functions Closes IDF-2206 Closes https://github.com/espressif/esp-idf/issues/6351
This commit is contained in:
@@ -180,14 +180,14 @@ struct PriorityInitTest
|
||||
int PriorityInitTest::order = 0;
|
||||
|
||||
// init_priority objects are initialized from the lowest to the heighest priority number
|
||||
// Default init_priority is always the lowest
|
||||
PriorityInitTest g_static_init_priority_test3;
|
||||
PriorityInitTest g_static_init_priority_test2 __attribute__((init_priority(1000)));
|
||||
PriorityInitTest g_static_init_priority_test1 __attribute__((init_priority(999)));
|
||||
// Default init_priority is always the lowest (highest priority number)
|
||||
PriorityInitTest g_static_init_priority_test2;
|
||||
PriorityInitTest g_static_init_priority_test1 __attribute__((init_priority(1000)));
|
||||
PriorityInitTest g_static_init_priority_test0 __attribute__((init_priority(999)));
|
||||
|
||||
TEST_CASE("init_priority extension works", "[cxx]")
|
||||
{
|
||||
TEST_ASSERT_EQUAL(0, g_static_init_priority_test1.index);
|
||||
TEST_ASSERT_EQUAL(1, g_static_init_priority_test2.index);
|
||||
TEST_ASSERT_EQUAL(2, g_static_init_priority_test3.index);
|
||||
TEST_ASSERT_EQUAL(0, g_static_init_priority_test0.index);
|
||||
TEST_ASSERT_EQUAL(1, g_static_init_priority_test1.index);
|
||||
TEST_ASSERT_EQUAL(2, g_static_init_priority_test2.index);
|
||||
}
|
||||
|
Reference in New Issue
Block a user