diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-03-23 15:44:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-03-23 15:44:41 +0100 |
commit | d05a900a5b58c17a896dc449e6ed7bca5430ff01 (patch) | |
tree | da83f9353a025e04f84780a317b8659dccf8c8fe /testsuites/sptests/sptls02/init.cc | |
parent | 3fd488915755766eb499ae8e002677734c64809e (diff) |
sptests/sptls02: Add test case
Add a test case which requires the use of __tls_guard() and
__tls_init().
Change license to BSD-2-Clause.
Diffstat (limited to 'testsuites/sptests/sptls02/init.cc')
-rw-r--r-- | testsuites/sptests/sptls02/init.cc | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/testsuites/sptests/sptls02/init.cc b/testsuites/sptests/sptls02/init.cc index 1cbefc6fcc..712358f978 100644 --- a/testsuites/sptests/sptls02/init.cc +++ b/testsuites/sptests/sptls02/init.cc @@ -1,28 +1,43 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014, 2016 embedded brains GmbH. All rights reserved. + * Copyright (C) 2014, 2020 embedded brains GmbH (http://www.embedded-brains.de) * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * 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. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H - #include "config.h" +#include "config.h" #endif +#include "sptls02.h" + #include <stdio.h> #include <stdlib.h> #include <rtems.h> #include <rtems/libcsupport.h> -#include "tmacros.h" +#include <tmacros.h> const char rtems_test_name[] = "SPTLS 2"; @@ -34,8 +49,14 @@ static thread_local long i0; alignas(512) static thread_local long a512; +int seven() +{ + return 7; +} + static void clobber() { + extern_int = 0xdead0007; i123 = 0xdead0001; a256 = 0xdead0002; i0 = 0xdead0003; @@ -144,6 +165,7 @@ static thread_local A a3(mc + 3); static void checkTLSValues() { + rtems_test_assert(extern_int == 7); rtems_test_assert(i123 == 123); rtems_test_assert(a256 == 256); rtems_test_assert((a256 & 255) == 0); |