struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / genericnonintrinsicnaddr.c
blob1080eb8321da62bc4bd1ad73d2652ce9bfa7f9ea
1 /*
2 C11 generic associations and their interaction with non-intrinsic named address spaces
3 */
5 #include <testfwk.h>
7 void set_a(void)
11 void set_b(void)
15 #ifndef PORT_HOST
16 __addressmod set_a space_a;
17 __addressmod set_b const space_b;
19 space_a int *ai;
20 space_b int *bi;
21 #endif
23 void testGeneric(void)
25 #ifndef PORT_HOST
26 ASSERT(_Generic(ai, default : 0, space_a int *: 1, space_b int* : 2) == 1);
27 ASSERT(_Generic(bi, default : 0, space_a int *: 1, space_b int* : 2) == 2);
28 #endif