Skip to content

Commit

Permalink
core_self_tests:.c: add SUB_OVERFLOW() test
Browse files Browse the repository at this point in the history
Add a test that fails with GCC 4.9.4 (Linaro GCC 4.9-2017.01) [1] with the
original overflow macros prior to commit 86ab9ff ("util: fix fallback
SUB_OVERFLOW() macro").

Link: [1] http://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabihf/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf.tar.xz
Signed-off-by: Jens Wiklander <[email protected]>
Acked-by: Jerome Forissier <[email protected]>
  • Loading branch information
jenswi-linaro authored and jforissier committed May 9, 2018
1 parent 0dfce39 commit bce296d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/arch/arm/pta/core_self_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ static int self_test_sub_overflow(void)
uint32_t r_u32;
int32_t r_s32;

if (SUB_OVERFLOW(8U, 1U, &r_s32))
return -1;
if (r_s32 != 7)
return -1;
if (SUB_OVERFLOW(32U, 30U, &r_u32))
return -1;
if (r_u32 != 2)
Expand Down

0 comments on commit bce296d

Please sign in to comment.