From da12925408a1fa650c7b6544b20fb44d85cf26ce Mon Sep 17 00:00:00 2001 From: marcobaye Date: Tue, 9 Jun 2020 18:52:49 +0000 Subject: [PATCH] started checking in test sources git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@223 4df02467-bbd4-4a76-a152-e7ce94205b78 --- src/alu.c | 1 + testing/errors/alreadydefined1.a | 2 ++ testing/errors/alreadydefined2.a | 2 ++ testing/errors/alreadydefined3.a | 4 ++++ testing/errors/toolateforpostfix1.a | 3 +++ testing/errors/toolateforpostfix2.a | 4 ++++ 6 files changed, 16 insertions(+) create mode 100644 testing/errors/alreadydefined1.a create mode 100644 testing/errors/alreadydefined2.a create mode 100644 testing/errors/alreadydefined3.a create mode 100644 testing/errors/toolateforpostfix1.a create mode 100644 testing/errors/toolateforpostfix2.a diff --git a/src/alu.c b/src/alu.c index 31e1654..9bc8a4f 100644 --- a/src/alu.c +++ b/src/alu.c @@ -1460,6 +1460,7 @@ static void int_handle_dyadic_operator(struct object *self, struct op *op, struc self->u.number.val.intval = ((uintval_t) (self->u.number.val.intval)) >> other->u.number.val.intval; break; case OPID_LESSOREQUAL: +// FIXME - all comparison results should clear all force bits and set fits_byte! also for floats! self->u.number.val.intval = (self->u.number.val.intval <= other->u.number.val.intval); break; case OPID_LESSTHAN: diff --git a/testing/errors/alreadydefined1.a b/testing/errors/alreadydefined1.a new file mode 100644 index 0000000..28583ab --- /dev/null +++ b/testing/errors/alreadydefined1.a @@ -0,0 +1,2 @@ + a = 3 + a = 3.0 ; -> "already defined" (type has changed) diff --git a/testing/errors/alreadydefined2.a b/testing/errors/alreadydefined2.a new file mode 100644 index 0000000..23123de --- /dev/null +++ b/testing/errors/alreadydefined2.a @@ -0,0 +1,2 @@ + a = 3 + a = 4 ; -> "already defined" (value has changed) diff --git a/testing/errors/alreadydefined3.a b/testing/errors/alreadydefined3.a new file mode 100644 index 0000000..6daccf4 --- /dev/null +++ b/testing/errors/alreadydefined3.a @@ -0,0 +1,4 @@ + *=$1000 +label + nop +label ; -> already defined diff --git a/testing/errors/toolateforpostfix1.a b/testing/errors/toolateforpostfix1.a new file mode 100644 index 0000000..62a4ab1 --- /dev/null +++ b/testing/errors/toolateforpostfix1.a @@ -0,0 +1,3 @@ + a = 3 + b = a ; read a + a+2 = 3 ; -> "too late for postfix" diff --git a/testing/errors/toolateforpostfix2.a b/testing/errors/toolateforpostfix2.a new file mode 100644 index 0000000..0ba2f8e --- /dev/null +++ b/testing/errors/toolateforpostfix2.a @@ -0,0 +1,4 @@ + *=$1000 +label + b = label ; read symbol +label+2 ; -> too late for postfix