zephyr/tests/subsys
Jonathon Penix 3723493f60 tests: coredump: Disable optimizations to prevent unexpected failures
debug.coredump.logging_backend is currently failing for most of the targets
I have tried when building with clang. Depending on the target, func_3
invokes undefined behavior by dereferencing addr (which is NULL) which
can lead to the compiler optimizing out significant portions of the code,
resulting in unexpected/incorrect failures.

Here, clang seems to inline func_3 into main then marks the inlined
implementation as unreachable (due to the UB) and removes it and everything
after it in main. So, we fall through to whatever code lies past main,
resulting in a test failure (timeout) from what I've seen. GCC seems to do
similar things, but creates an invalid opcode instruction so the test still
succeeds.

clang is correct in both optimizing this behavior out and leaving
buggy code behind, so disable optimizations for func_3 to keep things under
control and prevent the incorrect failures.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-03-23 19:04:06 -04:00
..
bindesc/definition hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
canbus/isotp drivers: can: remove run-time RTR filtering, add build-time RTR filter 2024-01-21 11:00:31 +01:00
debug tests: coredump: Disable optimizations to prevent unexpected failures 2024-03-23 19:04:06 -04:00
dfu tests/subsys/dfu: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
dsp hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
edac
emul
fs tests/subsys/fs: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
input tests/subsys/input: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
ipc
jwt
llext/simple tests: llext: fix conflict between BUILD_ONLY and "object" case 2024-03-19 10:28:52 +01:00
logging tests: logging: log_api: test LOG_WRN_ONCE 2024-03-21 10:07:36 +00:00
lorawan/clock_sync tests: subsys: lorawan: add clock_sync test 2024-03-01 17:35:04 +01:00
mem_mgmt tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
mgmt tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
modbus
modem hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
openthread tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
pm tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
portability
rtio/rtio_api
sd hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
settings tests/subsys/settings: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
shell
sip_svc
storage tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
testsuite/fff_fake_contexts tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
tracing/tracing_api
usb tests/subsys several: Use hwmv2 native targets identifiers 2024-03-15 16:13:12 +01:00
zbus hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00