Skip to content

unittests: tests-core doesn't compile for all platforms #2143

@phiros

Description

@phiros

Currently, the unit test for core doesn't compile for msp430 based platforms.
In my opinion at least the unit test for core must compile for every platform we support.

The primary problem seems to be the use of gcc compiler builtins (__builtin_clz and __builtin_ctz) in the bitarithm test:

$ msp430-gcc --version
msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make tests-core BOARD=telosb
touch /home/philipp/RIOT/tests/unittests/main.c
Building application unittests for telosb w/ MCU msp430f1611.
"make" -C /home/philipp/RIOT/boards/telosb
"make" -C /home/philipp/RIOT/core
"make" -C /home/philipp/RIOT/cpu/msp430x16x
"make" -C /home/philipp/RIOT/cpu/msp430-common
"make" -C /home/philipp/RIOT/drivers
"make" -C /home/philipp/RIOT/sys
"make" -C /home/philipp/RIOT/sys/oneway-malloc
"make" -C /home/philipp/RIOT/tests/unittests/embunit/embUnit
"make" -C /home/philipp/RIOT/tests/unittests/tests-core
/home/philipp/RIOT/tests/unittests/bin/telosb/tests-core.a(tests-core-bitarithm.o): In function `test_bitarithm_lsb_all':
/home/philipp/RIOT/tests/unittests/tests-core/tests-core-bitarithm.c:188: undefined reference to `__ctzhi2'
/home/philipp/RIOT/tests/unittests/bin/telosb/tests-core.a(tests-core-bitarithm.o): In function `test_bitarithm_msb_16bit':
/home/philipp/RIOT/tests/unittests/tests-core/tests-core-bitarithm.c:164: undefined reference to `__clzhi2'
collect2: ld returned 1 exit status
make: *** [all] Error 1

Does anybody have an idea how to fix this?

Metadata

Metadata

Assignees

Labels

Area: coreArea: RIOT kernel. Handle PRs marked with this with care!Area: testsArea: tests and testing frameworkCommunity: Hack'n'ACK candidateThis PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK partiesDiscussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PRPlatform: MSPPlatform: This PR/issue effects MSP-based platforms

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions