~mcf/cproc

0fb19daa48c89745b79bbf372a03c0f5be82ebe4 — Michael Forney a month ago 0e9e97e
Add test for string concatenation corner case
2 files changed, 15 insertions(+), 0 deletions(-)

A test/string-concat.c
A test/string-concat.qbe
A test/string-concat.c => test/string-concat.c +3 -0
@@ 0,0 1,3 @@
int main(void) {
	return "\0" "1"[0];
}

A test/string-concat.qbe => test/string-concat.qbe +12 -0
@@ 0,0 1,12 @@
data $.Lstring.2 = align 1 { b "\0001\000", }
export
function w $main() {
@start.1
@body.2
	%.1 =l extsw 0
	%.2 =l mul %.1, 1
	%.3 =l add $.Lstring.2, %.2
	%.4 =w loadsb %.3
	%.5 =w extsb %.4
	ret %.5
}