about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-20 23:34:04 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-20 23:36:00 -0700
commitf707ed0bac2ea4c938e145bc33cec517e499db29 (patch)
tree573c346d8e4d273b4c5165867138455739778652
parent5b840c7b2adecf49e9a5aacda0aa1f1fa4828fd4 (diff)
downloadmu-f707ed0bac2ea4c938e145bc33cec517e499db29.tar.gz
mu.subx: 15 failing tests remaining
The remaining tests are all for user-defined types and arrays.
-rw-r--r--apps/mu.subx19
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index 6dfb0849..d2fd384f 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -2215,7 +2215,7 @@ test-convert-function-with-nonlocal-unconditional-loop-and-local-vars:
     5d/pop-to-ebp
     c3/return
 
-_failing-test-convert-function-with-local-array-var-in-mem:
+test-convert-function-with-local-array-var-in-mem:
     # . prologue
     55/push-ebp
     89/<- %ebp 4/r32/esp
@@ -2261,7 +2261,7 @@ _failing-test-convert-function-with-local-array-var-in-mem:
     5d/pop-to-ebp
     c3/return
 
-_failing-test-convert-address:
+test-convert-address:
     # . prologue
     55/push-ebp
     89/<- %ebp 4/r32/esp
@@ -7191,14 +7191,15 @@ size-of-array:  # a: (addr tree type-id) -> result/eax: int
     #
     8b/-> *(ebp+8) 1/r32/ecx
     # TODO: assert that a->left is 'array'
-    8b/-> *(ecx+8) 1/r32/ecx  # Tree-right
-    # var elem-type/edx: type-id = a->right->value
-    8b/-> *(ecx+4) 2/r32/edx  # Tree-value
-    8b/-> *(edx+4) 2/r32/edx  # Tree-value
+    (lookup *(ecx+0xc) *(ecx+0x10))  # Tree-right Tree-right => eax
+    89/<- %ecx 0/r32/eax
+    # var elem-type/edx: type-id = a->right->left->value
+    (lookup *(ecx+4) *(ecx+8))  # Tree-left Tree-left => eax
+    8b/-> *(eax+4) 2/r32/edx  # Tree-value
     # var array-size/ecx: int = a->right->right->left->value
-    8b/-> *(ecx+8) 1/r32/ecx  # Tree-right
-    8b/-> *(ecx+4) 1/r32/ecx  # Tree-left
-    8b/-> *(ecx+4) 1/r32/ecx  # Tree-value
+    (lookup *(ecx+0xc) *(ecx+0x10))  # Tree-right Tree-right => eax
+    (lookup *(eax+4) *(eax+8))  # Tree-left Tree-left => eax
+    8b/-> *(eax+4) 1/r32/ecx  # Tree-value
     # return array-size * size-of(elem-type)
     (size-of-type-id %edx)  # => eax
     f7 4/subop/multiply-into-eax %ecx