From 530af63477e5264a312facf4a17b32cf79dbbd96 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 27 Nov 2020 00:17:51 -0800 Subject: 7287 Regression: I'd broken compare on bytes. Apparently I took away support for bytes from numberlike-output even though I didn't need to by the end. --- apps/mu.subx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'apps/mu.subx') diff --git a/apps/mu.subx b/apps/mu.subx index 91825443..55cf7c57 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -3821,6 +3821,35 @@ test-convert-compare-register-with-literal: 5d/pop-to-ebp c3/return +test-convert-compare-byte-with-literal: + # . prologue + 55/push-ebp + 89/<- %ebp 4/r32/esp + # setup + (clear-stream _test-input-stream) + (clear-stream $_test-input-buffered-file->buffer) + (clear-stream _test-output-stream) + (clear-stream $_test-output-buffered-file->buffer) + # + (write _test-input-stream "fn foo {\n") + (write _test-input-stream " var x/ecx: byte <- copy 0\n") + (write _test-input-stream " compare x, 0\n") + (write _test-input-stream "}\n") + # convert + (convert-mu _test-input-buffered-file _test-output-buffered-file Stderr 0) + (flush _test-output-buffered-file) +#? # dump _test-output-stream {{{ +#? (write 2 "^") +#? (write-stream 2 _test-output-stream) +#? (write 2 "$\n") +#? (rewind-stream _test-output-stream) +#? # }}} + # no errors; output is identical to test-convert-compare-register-with-literal + # . epilogue + 89/<- %esp 5/r32/ebp + 5d/pop-to-ebp + c3/return + test-unknown-variable: # . prologue 55/push-ebp @@ -21737,6 +21766,11 @@ $is-mu-numberlike-output?:check-boolean: (is-simple-mu-type? %esi 5) # boolean => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 +$is-mu-numberlike-output?:check-byte: + # if t is a byte, return + (is-simple-mu-type? %esi 8) # byte => eax + 3d/compare-eax-and 0/imm32/false + 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 $is-mu-numberlike-output?:check-code-point: # if t is a code-point, return (is-simple-mu-type? %esi 0xd) # code-point => eax -- cgit 1.4.1-2-gfad0