aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Chambers <andrewchambers@fastmail.com>2019-02-27 12:09:40 +1300
committerMichael Forney <mforney@mforney.org>2019-02-26 18:32:12 -0800
commit7722c7593a1a249e1a6d98d84afdff3cb086ca81 (patch)
tree49586cc1ffa3e9fd66ebcd090657050c0b117070 /tests
parent083bd95ef10c480fd234ec25933da27b2fa3fda9 (diff)
Zero uninitialized decls/returns.
Resolves #12 and #15.
Diffstat (limited to 'tests')
-rw-r--r--tests/compatible-function-types.qbe2
-rw-r--r--tests/for-loop.qbe1
-rw-r--r--tests/local-align.qbe7
-rw-r--r--tests/subtract-pointer.qbe2
-rw-r--r--tests/typedef-name.qbe1
-rw-r--r--tests/varargs.qbe22
6 files changed, 27 insertions, 8 deletions
diff --git a/tests/compatible-function-types.qbe b/tests/compatible-function-types.qbe
index 27d9b32..4111baa 100644
--- a/tests/compatible-function-types.qbe
+++ b/tests/compatible-function-types.qbe
@@ -8,8 +8,10 @@ export
function $f5(w %.1, d %.3) {
@start.3
%.2 =l alloc4 4
+ storew 0, %.2
storew %.1, %.2
%.4 =l alloc8 8
+ storel 0, %.4
stored %.3, %.4
@body.4
ret
diff --git a/tests/for-loop.qbe b/tests/for-loop.qbe
index 56b38b1..ea6f9af 100644
--- a/tests/for-loop.qbe
+++ b/tests/for-loop.qbe
@@ -4,6 +4,7 @@ function $f() {
%.1 =l alloc4 4
@body.2
storew 0, %.1
+ storew 0, %.1
@for_cond.3
%.2 =w loadsw %.1
%.3 =w csltw %.2, 10
diff --git a/tests/local-align.qbe b/tests/local-align.qbe
index bc3b85c..c789d88 100644
--- a/tests/local-align.qbe
+++ b/tests/local-align.qbe
@@ -3,5 +3,12 @@ function $f() {
@start.1
%.1 =l alloc16 4
@body.2
+ storeb 0, %.1
+ %.2 =l add %.1, 1
+ storeb 0, %.2
+ %.3 =l add %.1, 2
+ storeb 0, %.3
+ %.4 =l add %.1, 3
+ storeb 0, %.4
ret
}
diff --git a/tests/subtract-pointer.qbe b/tests/subtract-pointer.qbe
index 0e7e9a3..b075ce4 100644
--- a/tests/subtract-pointer.qbe
+++ b/tests/subtract-pointer.qbe
@@ -2,8 +2,10 @@ export
function $f(l %.1, l %.3) {
@start.1
%.2 =l alloc8 8
+ storel 0, %.2
storel %.1, %.2
%.4 =l alloc8 8
+ storel 0, %.4
storel %.3, %.4
@body.2
%.5 =l loadl %.2
diff --git a/tests/typedef-name.qbe b/tests/typedef-name.qbe
index 5ce995e..0520aae 100644
--- a/tests/typedef-name.qbe
+++ b/tests/typedef-name.qbe
@@ -3,5 +3,6 @@ function $f() {
@start.1
%.1 =l alloc8 8
@body.2
+ storel 0, %.1
ret
}
diff --git a/tests/varargs.qbe b/tests/varargs.qbe
index 16db877..42543a1 100644
--- a/tests/varargs.qbe
+++ b/tests/varargs.qbe
@@ -2,20 +2,26 @@ export
function $f(w %.1, ...) {
@start.1
%.2 =l alloc4 4
+ storew 0, %.2
storew %.1, %.2
%.3 =l alloc8 24
@body.2
+ storel 0, %.3
+ %.4 =l add %.3, 8
+ storel 0, %.4
+ %.5 =l add %.3, 16
+ storel 0, %.5
vastart %.3
@while_cond.3
- %.4 =w loadsw %.2
- jnz %.4, @while_body.4, @while_join.5
+ %.6 =w loadsw %.2
+ jnz %.6, @while_body.4, @while_join.5
@while_body.4
- %.5 =w vaarg %.3
- %.6 =s vaarg %.3
- %.7 =l vaarg %.3
- %.8 =w loadsw %.2
- %.9 =w sub %.8, 1
- storew %.9, %.2
+ %.7 =w vaarg %.3
+ %.8 =s vaarg %.3
+ %.9 =l vaarg %.3
+ %.10 =w loadsw %.2
+ %.11 =w sub %.10, 1
+ storew %.11, %.2
jmp @while_cond.3
@while_join.5
ret