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.
Russ Butler 2016-05-26 17:40:03 -05:00
parent bb17d6ada9
commit caa88ba9f4
2 changed files with 11 additions and 12 deletions

View File

@ -19,29 +19,28 @@ int testPacked() {
return failed; 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 testAlign() {
int failed = 0; int failed = 0;
ALIGN(8) char a; if(((uintptr_t)&a_align_test) & 0x7){
ALIGN(8) char b;
ALIGN(16) char c;
ALIGN(8) char d;
ALIGN(16) char e;
if(((uintptr_t)&a) & 0x7){
failed++; failed++;
} }
if(((uintptr_t)&b) & 0x7){ if(((uintptr_t)&b_align_test) & 0x7){
failed++; failed++;
} }
if(((uintptr_t)&c) & 0xf){ if(((uintptr_t)&c_align_test) & 0xf){
failed++; failed++;
} }
if(((uintptr_t)&d) & 0x7){ if(((uintptr_t)&d_align_test) & 0x7){
failed++; failed++;
} }
if(((uintptr_t)&e) & 0xf){ if(((uintptr_t)&e_align_test) & 0xf){
failed++; failed++;
} }

View File

@ -146,7 +146,7 @@
#if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
#define FORCEINLINE static inline __attribute__((always_inline)) #define FORCEINLINE static inline __attribute__((always_inline))
#elif defined(__ICCARM__) #elif defined(__ICCARM__)
#define FORCEINLINE _Pragma("inline=force") static #define FORCEINLINE _Pragma("inline=forced") static
#else #else
#define FORCEINLINE static inline #define FORCEINLINE static inline
#endif #endif