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). --- spec/build/testsuites/sptests/grp.yml | 2 ++ .../build/testsuites/sptests/libsplinkersets01.yml | 19 +++++++++++++ spec/build/testsuites/sptests/splinkersets01.yml | 2 -- 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 ---------------------- 8 files changed, 93 insertions(+), 34 deletions(-) create mode 100644 spec/build/testsuites/sptests/libsplinkersets01.yml 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 diff --git a/spec/build/testsuites/sptests/grp.yml b/spec/build/testsuites/sptests/grp.yml index 3ceddfad44..ac2f6626cd 100644 --- a/spec/build/testsuites/sptests/grp.yml +++ b/spec/build/testsuites/sptests/grp.yml @@ -12,6 +12,8 @@ ldflags: - -Wl,--wrap=printf - -Wl,--wrap=puts links: +- role: build-dependency + uid: libsplinkersets01 - role: build-dependency uid: sp01 - role: build-dependency diff --git a/spec/build/testsuites/sptests/libsplinkersets01.yml b/spec/build/testsuites/sptests/libsplinkersets01.yml new file mode 100644 index 0000000000..fe0bd12e55 --- /dev/null +++ b/spec/build/testsuites/sptests/libsplinkersets01.yml @@ -0,0 +1,19 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: library +cflags: [] +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +cppflags: [] +cxxflags: [] +enabled-by: true +includes: [] +install: [] +install-path: null +links: [] +source: +- testsuites/sptests/splinkersets01/content.c +- testsuites/sptests/splinkersets01/item-a.c +- testsuites/sptests/splinkersets01/item-ca.c +- testsuites/sptests/splinkersets01/sets.c +target: splinkersets01 +type: build diff --git a/spec/build/testsuites/sptests/splinkersets01.yml b/spec/build/testsuites/sptests/splinkersets01.yml index 99546550d8..aac5942d55 100644 --- a/spec/build/testsuites/sptests/splinkersets01.yml +++ b/spec/build/testsuites/sptests/splinkersets01.yml @@ -12,8 +12,6 @@ ldflags: [] links: [] source: - testsuites/sptests/splinkersets01/init.c -- testsuites/sptests/splinkersets01/items.c -- testsuites/sptests/splinkersets01/sets.c stlib: [] target: testsuites/sptests/splinkersets01.exe type: build 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