From fe46647ef5671095d17734792a1dcc675d54d34c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 15 Jun 2018 16:53:27 +0200 Subject: score: Macros to declare and define global symbols Add RTEMS_DEFINE_GLOBAL_SYMBOL() and add RTEMS_DECLARE_GLOBAL_SYMBOL(). Update #3459. --- testsuites/sptests/Makefile.am | 9 ++++++ testsuites/sptests/configure.ac | 1 + testsuites/sptests/spmisc01/init.c | 49 ++++++++++++++++++++++++++++++++ testsuites/sptests/spmisc01/spmisc01.doc | 13 +++++++++ testsuites/sptests/spmisc01/spmisc01.scn | 2 ++ 5 files changed, 74 insertions(+) create mode 100644 testsuites/sptests/spmisc01/init.c create mode 100644 testsuites/sptests/spmisc01/spmisc01.doc create mode 100644 testsuites/sptests/spmisc01/spmisc01.scn (limited to 'testsuites') diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index 8519702bb1..d3a2e10869 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -1493,6 +1493,15 @@ spmkdir_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spmkdir) \ $(support_includes) endif +if TEST_spmisc01 +sp_tests += spmisc01 +sp_screens += spmisc01/spmisc01.scn +sp_docs += spmisc01/spmisc01.doc +spmisc01_SOURCES = spmisc01/init.c +spmisc01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spmisc01) \ + $(support_includes) +endif + if TEST_spmountmgr01 sp_tests += spmountmgr01 sp_screens += spmountmgr01/spmountmgr01.scn diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index db213b9be5..ffbd7330ce 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -194,6 +194,7 @@ RTEMS_TEST_CHECK([spintrcritical23]) RTEMS_TEST_CHECK([spintrcritical24]) RTEMS_TEST_CHECK([splinkersets01]) RTEMS_TEST_CHECK([spmkdir]) +RTEMS_TEST_CHECK([spmisc01]) RTEMS_TEST_CHECK([spmountmgr01]) RTEMS_TEST_CHECK([spmrsp01]) RTEMS_TEST_CHECK([spmsgq_err01]) diff --git a/testsuites/sptests/spmisc01/init.c b/testsuites/sptests/spmisc01/init.c new file mode 100644 index 0000000000..4ff6365eeb --- /dev/null +++ b/testsuites/sptests/spmisc01/init.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include + +const char rtems_test_name[] = "SPMISC 1"; + +RTEMS_DECLARE_GLOBAL_SYMBOL(a_global_symbol); + +RTEMS_DEFINE_GLOBAL_SYMBOL(a_global_symbol, 0xabc); + +static void Init(rtems_task_argument arg) +{ + TEST_BEGIN(); + rtems_test_assert((uintptr_t)a_global_symbol == 0xabc); + TEST_END(); + rtems_test_exit(0); +} + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT + +#include diff --git a/testsuites/sptests/spmisc01/spmisc01.doc b/testsuites/sptests/spmisc01/spmisc01.doc new file mode 100644 index 0000000000..2654788f02 --- /dev/null +++ b/testsuites/sptests/spmisc01/spmisc01.doc @@ -0,0 +1,13 @@ +This file describes the directives and concepts tested by this test set. + +test set name: spbasedefs01 + +directives: + + - RTEMS_DECLARE_GLOBAL_SYMBOL() + - RTEMS_DEFINE_GLOBAL_SYMBOL() + +concepts: + + - Ensure that RTEMS_* defines and macros defined by + available via work as expected. diff --git a/testsuites/sptests/spmisc01/spmisc01.scn b/testsuites/sptests/spmisc01/spmisc01.scn new file mode 100644 index 0000000000..6e692dab8f --- /dev/null +++ b/testsuites/sptests/spmisc01/spmisc01.scn @@ -0,0 +1,2 @@ +*** BEGIN OF TEST SPMISC 1 *** +*** END OF TEST SPMISC 1 *** -- cgit v1.2.3