Skip to content

Commit caa88ba

Browse files
committed
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.
1 parent bb17d6a commit caa88ba

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

hal/TESTS/api/toolchain/attributes.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,28 @@ int testPacked() {
1919
return failed;
2020
}
2121

22+
ALIGN(8) static char a_align_test;
23+
ALIGN(8) static char b_align_test;
24+
ALIGN(16)static char c_align_test;
25+
ALIGN(8) static char d_align_test;
26+
ALIGN(16)static char e_align_test;
2227

2328
int testAlign() {
2429
int failed = 0;
2530

26-
ALIGN(8) char a;
27-
ALIGN(8) char b;
28-
ALIGN(16) char c;
29-
ALIGN(8) char d;
30-
ALIGN(16) char e;
31-
32-
if(((uintptr_t)&a) & 0x7){
31+
if(((uintptr_t)&a_align_test) & 0x7){
3332
failed++;
3433
}
35-
if(((uintptr_t)&b) & 0x7){
34+
if(((uintptr_t)&b_align_test) & 0x7){
3635
failed++;
3736
}
38-
if(((uintptr_t)&c) & 0xf){
37+
if(((uintptr_t)&c_align_test) & 0xf){
3938
failed++;
4039
}
41-
if(((uintptr_t)&d) & 0x7){
40+
if(((uintptr_t)&d_align_test) & 0x7){
4241
failed++;
4342
}
44-
if(((uintptr_t)&e) & 0xf){
43+
if(((uintptr_t)&e_align_test) & 0xf){
4544
failed++;
4645
}
4746

hal/api/toolchain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
#if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
147147
#define FORCEINLINE static inline __attribute__((always_inline))
148148
#elif defined(__ICCARM__)
149-
#define FORCEINLINE _Pragma("inline=force") static
149+
#define FORCEINLINE _Pragma("inline=forced") static
150150
#else
151151
#define FORCEINLINE static inline
152152
#endif

0 commit comments

Comments
 (0)