shithub: scc

ref: 8604fd05150d98be7c9503ec9a97b63f05371ff7
dir: /tests/cc/execute/0142-char-const.c/

View raw version
int
main(void)
{
	unsigned char uc;
	signed char sc;

	uc = -1;
	if ((uc & 0xFF) != 0xFF)
		return 1;

	uc = '\x23';
	if (uc != 36)
		return 1;

	uc = 1u;
	if (uc != (1025 & 0xFF)
		return 1;

	uc = 'A';
	if (uc != 0x41)
		return 1;

	sc = -1;
	if ((sc & 0xFF) != 0xFF)
		return 1;

	sc = '\x23';
	if (sc != 36)
		return 1;

	sc = 1u;
	if (uc != (1025 & 0xFF)
		return 1;

	sc = 'A';
	if (uc != 0x41)
		return 1;

	return 0;
}