aboutsummaryrefslogtreecommitdiff
path: root/tests/initializer-short-string.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-22 21:43:32 -0800
committerMichael Forney <mforney@mforney.org>2019-02-22 21:45:00 -0800
commit96fa8b352148f3843abe4f95958d765e40089f9b (patch)
tree1e7df3193920535f6df8ab6d31812a2a1a430d6d /tests/initializer-short-string.qbe
parente8863971221faba91357310b0c8be0fb2951ef22 (diff)
Make sure to zero the rest of an array initialized with a string
Diffstat (limited to 'tests/initializer-short-string.qbe')
-rw-r--r--tests/initializer-short-string.qbe27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/initializer-short-string.qbe b/tests/initializer-short-string.qbe
new file mode 100644
index 0000000..5b95ea1
--- /dev/null
+++ b/tests/initializer-short-string.qbe
@@ -0,0 +1,27 @@
+export
+function $f() {
+@start.1
+ %.1 =l alloc4 10
+@body.2
+ %.2 =l add %.1, 0
+ storeb 97, %.2
+ %.3 =l add %.1, 1
+ storeb 98, %.3
+ %.4 =l add %.1, 2
+ storeb 99, %.4
+ %.5 =l add %.1, 3
+ storeb 0, %.5
+ %.6 =l add %.1, 4
+ storeb 0, %.6
+ %.7 =l add %.1, 5
+ storeb 0, %.7
+ %.8 =l add %.1, 6
+ storeb 0, %.8
+ %.9 =l add %.1, 7
+ storeb 0, %.9
+ %.10 =l add %.1, 8
+ storeb 0, %.10
+ %.11 =l add %.1, 9
+ storeb 0, %.11
+ ret
+}