Skip to content

Commit eaf5e7d

Browse files
committed
[nrf fromtree] tests: arch: common: interrupt: Add missing volatile keyword
Variables that were set in the interrupt context were missing volatile keyword and test was failing on some targets when LTO was enabled (could also failed without LTO). Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no> (cherry picked from commit 6eedfa8)
1 parent 39ba442 commit eaf5e7d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/arch/common/interrupt/src/nested_irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
static uint32_t irq_line_0;
9999
static uint32_t irq_line_1;
100100

101-
static uint32_t isr0_result;
102-
static uint32_t isr1_result;
101+
static volatile uint32_t isr0_result;
102+
static volatile uint32_t isr1_result;
103103

104104
void isr1(const void *param)
105105
{

tests/arch/common/interrupt/src/test_shared_irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static inline void name(const void *data) \
2929
test_vector[idx] = result_vector[idx]; \
3030
} \
3131

32-
static uint32_t test_vector[TEST_VECTOR_SIZE] = {
32+
static volatile uint32_t test_vector[TEST_VECTOR_SIZE] = {
3333
};
3434

3535
static uint32_t result_vector[TEST_VECTOR_SIZE] = {

0 commit comments

Comments
 (0)