#ifdef __cplusplus
# define EXTERN_C extern "C"
#else
# define EXTERN_C extern
#endif
EXTERN_C int printf(const char *,...);
typedef enum : short { Constant = 0 } TestEnum;
void test(TestEnum input) {
printf("%hhd", input); printf("%hhd", Constant);
printf("%hd", input); printf("%hd", Constant);
printf("%d", input); printf("%d", Constant);
printf("%lld", input); printf("%lld", Constant); }
typedef enum : unsigned long { LongConstant = ~0UL } LongEnum;
void testLong(LongEnum input) {
printf("%u", input); printf("%u", LongConstant);
printf("%lu", input);
printf("%lu", LongConstant);
}
typedef short short_t;
typedef enum : short_t { ShortConstant = 0 } ShortEnum;
void testUnderlyingTypedef(ShortEnum input) {
printf("%hhd", input); printf("%hhd", ShortConstant);
printf("%hd", input); printf("%hd", ShortConstant);
printf("%d", input); printf("%d", ShortConstant);
printf("%lld", input); printf("%lld", ShortConstant); }
typedef ShortEnum ShortEnum2;
void testTypedefChain(ShortEnum2 input) {
printf("%hhd", input); printf("%hd", input); printf("%d", input); printf("%lld", input); }
typedef enum : char { CharConstant = 'a' } CharEnum;
void testChar(CharEnum input) {
printf("%hhd", input); printf("%hhd", CharConstant);
printf("%hd", input);
printf("%hd", CharConstant);
printf("%d", input); printf("%d", CharConstant);
printf("%lld", input); printf("%lld", CharConstant); }