userland: start refactor to show failing values on failure!

aarch64 basically done, but missing:

- other archs
- maybe convert main.c into C++ to use templates?
- full review of ASSERT_EQ calling convention issues not seen by tests
  by chance
- documentation
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 5711e85e70
commit f176d04500
14 changed files with 240 additions and 163 deletions

View File

@@ -5,27 +5,27 @@
ENTRY
/* Save sp before push. */
mov r0, sp
mov r4, sp
/* Push. */
mov r1, 1
mov r2, 2
push {r1, r2}
mov r5, 1
mov r6, 2
push {r5, r6}
/* Save sp after push. */
mov r1, sp
mov r5, sp
/* Restore. */
mov r3, 0
mov r4, 0
pop {r3, r4}
ASSERT_EQ(r3, 1)
ASSERT_EQ(r4, 2)
mov r7, 0
mov r8, 0
pop {r7, r8}
ASSERT_EQ(r7, 1)
ASSERT_EQ(r8, 2)
/* Check that stack pointer moved down by 8 bytes
* (2 registers x 4 bytes each).
*/
sub r0, r1
ASSERT_EQ(r0, 8)
sub r4, r5
ASSERT_EQ(r4, 8)
EXIT