1 /** bit-precise integers as variable parameters
3 width: 6, 8, 9, 15, 16, 17, 24, 32, 33, 40, 48, 63, 64, 65
11 // clang 11 supports bit-precise types, but deviates a bit from C23. This test fails using clang 11.0.1 on FreeBSd 13.0 (passes using clang 11.1.0 on Debian GNU/Linux).
12 #if __clang_major__ == 11 && __clang_minor__ >= 1
13 #define __SDCC_BITINT_MAXWIDTH 128
14 #define _BitInt _ExtInt
17 #if __SDCC_BITINT_MAXWIDTH >= {width} // TODO: When we can regression-test in --std-c23 mode, use the standard macro from limits.h instead!
19 typedef unsigned _BitInt({width
}) bitinttype
;
22 returnFirstArg(int marker
, ...)
28 i
= va_arg(ap
, bitinttype
);
36 returnSecondArg(int marker
, ...)
42 UNUSED(va_arg(ap
, bitinttype
));
43 i
= va_arg(ap
, bitinttype
);
52 testBitIntVarArg(void)
54 #if __SDCC_BITINT_MAXWIDTH >= {width} // TODO: When we can regression-test in --std-c23 mode, use the standard macro from limits.h instead!
55 #if !defined(__SDCC_mcs51) || {width} != 33 // Bug #3363
58 ASSERT(returnFirstArg(marker
, (bitinttype
)0xaaaaaaaaaaaaaaaaull
, (bitinttype
)0x5555555555555555ull
) == (bitinttype
)0xaaaaaaaaaaaaaaaaull
);
59 ASSERT(returnSecondArg(marker
, (bitinttype
)0xaaaaaaaaaaaaaaaaull
, (bitinttype
)0x5555555555555555ull
) == (bitinttype
)0x5555555555555555ull
);