struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / genericintrinsicnaddr.c
blob28401329e37e900aa958ebfe3c4b82e989d1a537
1 /*
2 C11 generic associations and their interaction with intrinsic named address spaces
3 */
5 #include <testfwk.h>
7 // Only some ports have intrinsic named address spaces
8 #if defined(__SDCC_mcs51)
9 __near int *ni;
10 __code int *ci;
11 int *i;
12 #endif
14 void testGeneric(void)
16 // Only some ports have intrinsic named address spaces
17 #if defined(__SDCC_mcs51)
18 ASSERT(_Generic(ni, default : 0, __near int *: 1, __code int* : 2) == 1);
19 ASSERT(_Generic(ci, default : 0, __near int *: 1, __code int* : 2) == 2);
20 #endif