From caa88ba9f4cc3bf564f25126a58a21041af70ac1 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Thu, 26 May 2016 17:40:03 -0500 Subject: [PATCH] More IAR test fixes Make the following changes: -Fix keyword used in forced inline pragma -Move alignment test variables off of the stack since alignment there is platform dependent. --- hal/TESTS/api/toolchain/attributes.c | 21 ++++++++++----------- hal/api/toolchain.h | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/hal/TESTS/api/toolchain/attributes.c b/hal/TESTS/api/toolchain/attributes.c index 196d968c1c..25c0df7294 100644 --- a/hal/TESTS/api/toolchain/attributes.c +++ b/hal/TESTS/api/toolchain/attributes.c @@ -19,29 +19,28 @@ int testPacked() { return failed; } +ALIGN(8) static char a_align_test; +ALIGN(8) static char b_align_test; +ALIGN(16)static char c_align_test; +ALIGN(8) static char d_align_test; +ALIGN(16)static char e_align_test; int testAlign() { int failed = 0; - ALIGN(8) char a; - ALIGN(8) char b; - ALIGN(16) char c; - ALIGN(8) char d; - ALIGN(16) char e; - - if(((uintptr_t)&a) & 0x7){ + if(((uintptr_t)&a_align_test) & 0x7){ failed++; } - if(((uintptr_t)&b) & 0x7){ + if(((uintptr_t)&b_align_test) & 0x7){ failed++; } - if(((uintptr_t)&c) & 0xf){ + if(((uintptr_t)&c_align_test) & 0xf){ failed++; } - if(((uintptr_t)&d) & 0x7){ + if(((uintptr_t)&d_align_test) & 0x7){ failed++; } - if(((uintptr_t)&e) & 0xf){ + if(((uintptr_t)&e_align_test) & 0xf){ failed++; } diff --git a/hal/api/toolchain.h b/hal/api/toolchain.h index b8756d206c..6baa6bd51a 100644 --- a/hal/api/toolchain.h +++ b/hal/api/toolchain.h @@ -146,7 +146,7 @@ #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) #define FORCEINLINE static inline __attribute__((always_inline)) #elif defined(__ICCARM__) -#define FORCEINLINE _Pragma("inline=force") static +#define FORCEINLINE _Pragma("inline=forced") static #else #define FORCEINLINE static inline #endif