diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-12 17:53:35 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-13 11:06:58 +0200 |
commit | 1c53643205669ef1471e5cdb7650dedc14a759ce (patch) | |
tree | afa4ca76450759a5c6210b1a5fcf503b9f215fd6 /spec | |
parent | 833e2e48a7fa24e71fbcf1eb1645384c9256bab5 (diff) |
spec: Improve RTEMS_DEFINE_GLOBAL_SYMBOL() tests
Use a symbol value relative to an existing symbol address to make the
test work on more code models.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/rtems/basedefs/val/basedefs.yml | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/rtems/basedefs/val/basedefs.yml b/spec/rtems/basedefs/val/basedefs.yml index 36aefc6f..a0732956 100644 --- a/spec/rtems/basedefs/val/basedefs.yml +++ b/spec/rtems/basedefs/val/basedefs.yml @@ -438,7 +438,11 @@ test-actions: basedefs_get_global_symbol() which is defined in a file different from the file in which the gobal symbol is defined. code: | - T_step_eq_int( ${.:/step}, basedefs_get_global_symbol(), 0xabc ); + T_step_eq_uptr( + ${.:/step}, + basedefs_get_global_symbol() - (uintptr_t) &global_symbol_base, + 0xabc + ); links: - role: validation uid: ../req/declare-global-symbol-0 @@ -472,7 +476,11 @@ test-actions: Check that the ${../if/define-global-symbol:/name} macro defines a global symbol with the correct value. code: | - T_step_eq_int( ${.:/step}, (uintptr_t) global_symbol, 0xabc ); + T_step_eq_uptr( + ${.:/step}, + (uintptr_t) global_symbol - (uintptr_t) &global_symbol_base, + 0xabc + ); links: - role: validation uid: ../req/define-global-symbol-0 @@ -1454,8 +1462,12 @@ test-support: | return 21; } + static int global_symbol_base; + RTEMS_DEFINE_GLOBAL_SYMBOL( - GLOBAL_SYMBOL, GLOBAL_SYMBOL_VALULE( abc ) ); + GLOBAL_SYMBOL, + RTEMS_SYMBOL_NAME( global_symbol_base ) + GLOBAL_SYMBOL_VALULE( abc ) + ); static int deprecated_func( int i ) RTEMS_DEPRECATED; static int deprecated_func( int i ) |