Skip to content

Commit da51747

Browse files
committed
[cov,test] Apply OT_NO_COVERAGE to sram exec test
When testing code that is copied and executed from SRAM, coverage instrumentation can lead to crashes since the relative address to coverage counters on SRAM becomes invalid. This patch applies the `OT_NO_COVERAGE` attribute to the `test_stub` function in `sram_exec_test.c` to prevent the compiler from inserting coverage counters. Change-Id: I55641d42b5a6113ec757d8c6ec7fab7f39556347 Signed-off-by: Yi-Hsuan Deng <[email protected]>
1 parent 344e805 commit da51747

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

sw/device/silicon_creator/rom_ext/e2e/handoff/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ SRAM_EXEC_TESTCASES = [
183183
"//hw/ip/sram_ctrl/data:sram_ctrl_c_regs",
184184
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
185185
"//sw/device/lib/base:abs_mmio",
186+
"//sw/device/lib/base:macros",
186187
"//sw/device/lib/testing/test_framework:ottf_main",
187188
"//sw/device/silicon_creator/lib:dbg_print",
188189
],

sw/device/silicon_creator/rom_ext/e2e/handoff/sram_exec_test.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
#include "sw/device/lib/base/abs_mmio.h"
6+
#include "sw/device/lib/base/macros.h"
67
#include "sw/device/lib/testing/test_framework/ottf_main.h"
78
#include "sw/device/silicon_creator/lib/dbg_print.h"
89

@@ -15,6 +16,7 @@ enum {
1516
kBase = TOP_EARLGREY_SRAM_CTRL_MAIN_REGS_BASE_ADDR,
1617
};
1718

19+
OT_NO_COVERAGE
1820
int test_stub(void) { return 0x42; }
1921

2022
// SRAM copy of `test_stub` bytecodes.

0 commit comments

Comments
 (0)