Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / unreachable.c
blob4f0169b8d0f80cde8b47eba1e0a3944d782b4310
1 /*
2 C2X unreachable
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c23
10 #include <stddef.h>
12 // todo: drop dis extra macro once we have c23 preprocessor support
13 #ifndef unreachable
14 #define unreachable __builtin_unreachable
15 #endif
17 volatile int i;
19 void f(void)
21 if(i)
22 unreachable();
24 #endif
26 void
27 testUnreachable(void)
29 #ifdef __SDCC
30 if(0)
31 unreachable();
32 f();
33 #endif