From 2769554243c43eee9fd5066a5cd770ab89ec47a3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 10 Jun 2021 08:41:05 +0200 Subject: splinkersets01: Test linker sets in library Make sure that the linker sets work if placed in a library (this is how they are used in RTEMS). --- testsuites/sptests/Makefile.am | 4 +++- testsuites/sptests/splinkersets01/content.c | 27 +++++++++++++++++++++++++ testsuites/sptests/splinkersets01/item-a.c | 21 +++++++++++++++++++ testsuites/sptests/splinkersets01/item-ca.c | 21 +++++++++++++++++++ testsuites/sptests/splinkersets01/items.c | 31 ----------------------------- 5 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 testsuites/sptests/splinkersets01/content.c create mode 100644 testsuites/sptests/splinkersets01/item-a.c create mode 100644 testsuites/sptests/splinkersets01/item-ca.c delete mode 100644 testsuites/sptests/splinkersets01/items.c (limited to 'testsuites') diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index 8813d43513..8a9d968925 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -1943,7 +1943,9 @@ endif if TEST_splinkersets01 sp_libs += libsplinkersets01.a libsplinkersets01_a_SOURCES = splinkersets01/sets.c \ - splinkersets01/items.c + splinkersets01/content.c \ + splinkersets01/item-a.c \ + splinkersets01/item-ca.c endif noinst_PROGRAMS = $(sp_tests) diff --git a/testsuites/sptests/splinkersets01/content.c b/testsuites/sptests/splinkersets01/content.c new file mode 100644 index 0000000000..4de2827575 --- /dev/null +++ b/testsuites/sptests/splinkersets01/content.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2015, 2016 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.com/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "splinkersets01.h" + +int content_rw_1; +char content_rw_2; +char content_rw_3; + +const int content_ro_1; +const char content_ro_2; +const char content_ro_3; diff --git a/testsuites/sptests/splinkersets01/item-a.c b/testsuites/sptests/splinkersets01/item-a.c new file mode 100644 index 0000000000..30f81bf776 --- /dev/null +++ b/testsuites/sptests/splinkersets01/item-a.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2015, 2016 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.com/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "splinkersets01.h" + +RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a1, 1) = &a[1]; diff --git a/testsuites/sptests/splinkersets01/item-ca.c b/testsuites/sptests/splinkersets01/item-ca.c new file mode 100644 index 0000000000..23937db925 --- /dev/null +++ b/testsuites/sptests/splinkersets01/item-ca.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2015, 2016 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.com/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "splinkersets01.h" + +RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca2, OC) = &ca[2]; diff --git a/testsuites/sptests/splinkersets01/items.c b/testsuites/sptests/splinkersets01/items.c deleted file mode 100644 index 3072c64a7a..0000000000 --- a/testsuites/sptests/splinkersets01/items.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2015, 2016 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.com/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "splinkersets01.h" - -RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a1, 1) = &a[1]; - -RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca2, OC) = &ca[2]; - -int content_rw_1; -char content_rw_2; -char content_rw_3; - -const int content_ro_1; -const char content_ro_2; -const char content_ro_3; -- cgit v1.2.3