aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/initializer-string-array.c3
-rw-r--r--tests/initializer-string-array.qbe23
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/initializer-string-array.c b/tests/initializer-string-array.c
new file mode 100644
index 0000000..9ccc9d0
--- /dev/null
+++ b/tests/initializer-string-array.c
@@ -0,0 +1,3 @@
+void f(void) {
+ char x[][4] = {"abc", "xyz"};
+}
diff --git a/tests/initializer-string-array.qbe b/tests/initializer-string-array.qbe
new file mode 100644
index 0000000..87a03fd
--- /dev/null
+++ b/tests/initializer-string-array.qbe
@@ -0,0 +1,23 @@
+export
+function $f() {
+@start.1
+ %.1 =l alloc4 8
+@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 120, %.6
+ %.7 =l add %.1, 5
+ storeb 121, %.7
+ %.8 =l add %.1, 6
+ storeb 122, %.8
+ %.9 =l add %.1, 7
+ storeb 0, %.9
+ ret
+}