aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-10-02 01:06:47 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitfa03e7d230f2625c384ca9a7c314b6d05ab44e70 (patch)
tree3304f6b7b6bd2953e4b4da75bf0387650a9eaa90 /tests
parentb124548bcee1ab6d034d4499fe695073566ae37d (diff)
Switch signed<->unsigned asm instructions for logical op
Diffstat (limited to 'tests')
-rw-r--r--tests/binop.amal14
-rw-r--r--tests/main.c1
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/binop.amal b/tests/binop.amal
new file mode 100644
index 0000000..1ec826d
--- /dev/null
+++ b/tests/binop.amal
@@ -0,0 +1,14 @@
+extern const printf: fn(fmt: ?&c_char, ...) c_int;
+
+const main = fn {
+ var value = 23 + 50;
+ if value < 23
+ printf("less!\n");
+ else
+ printf("more!\n");
+
+ while value >= 0 {
+ printf("value: %ld\n", value);
+ value = value - 1;
+ }
+} \ No newline at end of file
diff --git a/tests/main.c b/tests/main.c
index 0b3a744..f555e16 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -321,6 +321,7 @@ static void run_all_tests(void) {
test_load("tests/main.amal");
test_load("tests/utf8bom.amal");
test_load("tests/bytecode.amal");
+ test_load("tests/binop.amal");
test_load_error("tests/errors/duplicate_declaration.amal",
"2:7: error: Variable with the name main was declared twice in the same scope\n"