1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 15:31:17 +01:00

Merge pull request #13462 from dylad/pr/saml1x/fix_unittests

tests/unittests: fix GCC compiler bug in core-atomic for SAML1X
This commit is contained in:
Kaspar Schleiser 2020-02-26 12:38:22 +01:00 committed by GitHub
commit 426b0d70d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -1,9 +1,6 @@
DEVELHELP ?= 0
include ../Makefile.tests_common
# temporarily disable building, see #13456.
BOARD_BLACKLIST := saml10-xpro saml11-xpro
USEMODULE += embunit
ifeq (, $(filter tests-%, $(MAKECMDGOALS)))

View File

@ -26,6 +26,11 @@ static void test_atomic_flag(void)
TEST_ASSERT_EQUAL_INT(0, atomic_flag_test_and_set(&flag));
}
/* Prevent compiler optimization for SAML1X because of gcc internal bug */
#ifdef CPU_ARCH_CORTEX_M23
#pragma GCC push_options
#pragma GCC optimize ("O0")
#endif
/* Test atomic_fetch_add */
static void test_atomic_inc_positive(void)
{
@ -51,11 +56,7 @@ static void test_atomic_inc_negative(void)
TEST_ASSERT_EQUAL_INT(i + 1, atomic_load(&res));
}
}
/* Prevent compiler optimization for SAML1X because of gcc internal bug */
#ifdef CPU_SAML1X
#pragma GCC push_options
#pragma GCC optimize ("O0")
#endif
static void test_atomic_inc_rollover(void)
{
atomic_int res = ATOMIC_VAR_INIT(INT_MAX - 30);