~mcf/cproc

34ae0d48e9669687003c26f94e07fa00d12dd41f — Michael Forney a month ago e07ea69
Add tests for char/wchar_t signedness
A test/char-sign+aarch64.c => test/char-sign+aarch64.c +4 -0
@@ 0,0 1,4 @@
int x = (char)-1 < 0;
int main(void) {
	return (char)-1 < 0;
}

A test/char-sign+aarch64.qbe => test/char-sign+aarch64.qbe +10 -0
@@ 0,0 1,10 @@
export data $x = align 4 { w 0, }
export
function w $main() {
@start.1
@body.2
	%.1 =w sub 0, 1
	%.2 =w extub %.1
	%.3 =w csltw %.2, 0
	ret %.3
}

A test/char-sign+riscv64.c => test/char-sign+riscv64.c +4 -0
@@ 0,0 1,4 @@
int x = (char)-1 < 0;
int main(void) {
	return (char)-1 < 0;
}

A test/char-sign+riscv64.qbe => test/char-sign+riscv64.qbe +10 -0
@@ 0,0 1,10 @@
export data $x = align 4 { w 0, }
export
function w $main() {
@start.1
@body.2
	%.1 =w sub 0, 1
	%.2 =w extub %.1
	%.3 =w csltw %.2, 0
	ret %.3
}

A test/char-sign+x86_64.c => test/char-sign+x86_64.c +4 -0
@@ 0,0 1,4 @@
int x = (char)-1 > 0;
int main(void) {
	return (char)-1 > 0;
}

A test/char-sign+x86_64.qbe => test/char-sign+x86_64.qbe +10 -0
@@ 0,0 1,10 @@
export data $x = align 4 { w 0, }
export
function w $main() {
@start.1
@body.2
	%.1 =w sub 0, 1
	%.2 =w extsb %.1
	%.3 =w csgtw %.2, 0
	ret %.3
}

A test/wchar-sign+aarch64.c => test/wchar-sign+aarch64.c +4 -0
@@ 0,0 1,4 @@
int x = -L'\001' < 0;
int main(void) {
	return -L'\001' < 0;
}

A test/wchar-sign+aarch64.qbe => test/wchar-sign+aarch64.qbe +9 -0
@@ 0,0 1,9 @@
export data $x = align 4 { w 0, }
export
function w $main() {
@start.1
@body.2
	%.1 =w sub 0, 1
	%.2 =w cultw %.1, 0
	ret %.2
}

A test/wchar-sign+riscv64.c => test/wchar-sign+riscv64.c +4 -0
@@ 0,0 1,4 @@
int x = -L'\001' > 0;
int main(void) {
	return -L'\001' > 0;
}

A test/wchar-sign+riscv64.qbe => test/wchar-sign+riscv64.qbe +9 -0
@@ 0,0 1,9 @@
export data $x = align 4 { w 0, }
export
function w $main() {
@start.1
@body.2
	%.1 =w sub 0, 1
	%.2 =w csgtw %.1, 0
	ret %.2
}

A test/wchar-sign+x86_64.c => test/wchar-sign+x86_64.c +4 -0
@@ 0,0 1,4 @@
int x = -L'\001' > 0;
int main(void) {
	return -L'\001' > 0;
}

A test/wchar-sign+x86_64.qbe => test/wchar-sign+x86_64.qbe +9 -0
@@ 0,0 1,9 @@
export data $x = align 4 { w 0, }
export
function w $main() {
@start.1
@body.2
	%.1 =w sub 0, 1
	%.2 =w csgtw %.1, 0
	ret %.2
}