diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-14 14:03:16 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-14 14:25:49 +0200 |
commit | 5f8415b92e2787e5f11fd0808af341b40ae2d17c (patch) | |
tree | 6b1a8a07b858711537ddd6727100d36bd4bf50ab /testsuites | |
parent | sp37: Check ISR level of system init (diff) | |
download | rtems-5f8415b92e2787e5f11fd0808af341b40ae2d17c.tar.bz2 |
validation: Add RTEMS_DEFINE_GLOBAL_SYMBOL() test
Update #4953.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/validation/tc-basedefs.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/testsuites/validation/tc-basedefs.c b/testsuites/validation/tc-basedefs.c index 28c11af505..835f76ec64 100644 --- a/testsuites/validation/tc-basedefs.c +++ b/testsuites/validation/tc-basedefs.c @@ -432,6 +432,12 @@ * - Checked that the RTEMS_ZERO_LENGTH_ARRAY macro produces a structure * similar to a structure with one element. * + * - Use the RTEMS_DEFINE_GLOBAL_SYMBOL() macro at the beginning of this file + * and assign the address of the symbol to an object. + * + * - Check that the RTEMS_DEFINE_GLOBAL_SYMBOL() macro defines a global + * symbol with the correct value. + * * @{ */ @@ -534,6 +540,12 @@ RTEMS_DEFINE_GLOBAL_SYMBOL( RTEMS_SYMBOL_NAME( global_symbol_base ) + GLOBAL_SYMBOL_VALULE( abc ) ); +RTEMS_DECLARE_GLOBAL_SYMBOL( global_symbol_2 ); + +RTEMS_DEFINE_GLOBAL_SYMBOL( global_symbol_2, 0x123 ); + +static const char * const volatile global_symbol_2_object = global_symbol_2; + static int deprecated_func( int i ) RTEMS_DEPRECATED; static int deprecated_func( int i ) { @@ -1938,11 +1950,26 @@ static void RtemsBasedefsValBasedefs_Action_55( void ) } /** + * @brief Use the RTEMS_DEFINE_GLOBAL_SYMBOL() macro at the beginning of this + * file and assign the address of the symbol to an object. + */ +static void RtemsBasedefsValBasedefs_Action_56( void ) +{ + /* No action */ + + /* + * Check that the RTEMS_DEFINE_GLOBAL_SYMBOL() macro defines a global symbol + * with the correct value. + */ + T_step_eq_uptr( 129, (uintptr_t) global_symbol_2_object, 0x123 ); +} + +/** * @fn void T_case_body_RtemsBasedefsValBasedefs( void ) */ T_TEST_CASE( RtemsBasedefsValBasedefs ) { - T_plan( 129 ); + T_plan( 130 ); RtemsBasedefsValBasedefs_Action_0(); RtemsBasedefsValBasedefs_Action_1(); @@ -2000,6 +2027,7 @@ T_TEST_CASE( RtemsBasedefsValBasedefs ) RtemsBasedefsValBasedefs_Action_53(); RtemsBasedefsValBasedefs_Action_54(); RtemsBasedefsValBasedefs_Action_55(); + RtemsBasedefsValBasedefs_Action_56(); } /** @} */ |