aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/initializer-empty-struct.c5
-rw-r--r--test/initializer-empty-struct.qbe8
-rw-r--r--test/initializer-empty.c4
-rw-r--r--test/initializer-empty.qbe8
4 files changed, 25 insertions, 0 deletions
diff --git a/test/initializer-empty-struct.c b/test/initializer-empty-struct.c
new file mode 100644
index 0000000..01538f5
--- /dev/null
+++ b/test/initializer-empty-struct.c
@@ -0,0 +1,5 @@
+struct s {float x; long y;};
+struct s s = {};
+void f(void) {
+ struct s t = {};
+}
diff --git a/test/initializer-empty-struct.qbe b/test/initializer-empty-struct.qbe
new file mode 100644
index 0000000..9bbfb34
--- /dev/null
+++ b/test/initializer-empty-struct.qbe
@@ -0,0 +1,8 @@
+export data $s = align 8 { z 16 }
+export
+function $f() {
+@start.1
+ %.1 =l alloc8 16
+@body.2
+ ret
+}
diff --git a/test/initializer-empty.c b/test/initializer-empty.c
new file mode 100644
index 0000000..e3e444c
--- /dev/null
+++ b/test/initializer-empty.c
@@ -0,0 +1,4 @@
+int x = {};
+void f(void) {
+ int y = {};
+}
diff --git a/test/initializer-empty.qbe b/test/initializer-empty.qbe
new file mode 100644
index 0000000..2ed8249
--- /dev/null
+++ b/test/initializer-empty.qbe
@@ -0,0 +1,8 @@
+export data $x = align 4 { z 4 }
+export
+function $f() {
+@start.1
+ %.1 =l alloc4 4
+@body.2
+ ret
+}