aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2024-03-16 00:43:43 -0700
committerMichael Forney <mforney@mforney.org>2024-03-16 00:45:04 -0700
commitad769cfc78bea044ac4b2f19fe5a0ed79fc423a5 (patch)
treef1fc035ab64346d17eb6aa5973e59bef1303a255 /test
parente96df56b734d0a2619e7690c60a5472449d086c1 (diff)
downloadcproc-ad769cfc78bea044ac4b2f19fe5a0ed79fc423a5.tar.xz
Fix C23 empty initializers
These should should act as zero initializers, but since init==NULL was used to mean both "no initializer" and "empty initializer", empty initializers weren't zero-initializing the variable.
Diffstat (limited to 'test')
-rw-r--r--test/initializer-empty-struct.qbe3
-rw-r--r--test/initializer-empty.qbe1
2 files changed, 4 insertions, 0 deletions
diff --git a/test/initializer-empty-struct.qbe b/test/initializer-empty-struct.qbe
index 9bbfb34..400f504 100644
--- a/test/initializer-empty-struct.qbe
+++ b/test/initializer-empty-struct.qbe
@@ -4,5 +4,8 @@ function $f() {
@start.1
%.1 =l alloc8 16
@body.2
+ storel 0, %.1
+ %.2 =l add %.1, 8
+ storel 0, %.2
ret
}
diff --git a/test/initializer-empty.qbe b/test/initializer-empty.qbe
index 2ed8249..f3358bd 100644
--- a/test/initializer-empty.qbe
+++ b/test/initializer-empty.qbe
@@ -4,5 +4,6 @@ function $f() {
@start.1
%.1 =l alloc4 4
@body.2
+ storew 0, %.1
ret
}