aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-04-14 14:57:01 -0700
committerMichael Forney <mforney@mforney.org>2021-05-02 11:56:52 -0700
commitab3187e9d02a9e4c3395c28858ac179d1fc5787b (patch)
tree9365a19767b35e00bfe2e9cfcf5e82fd113f4895 /test
parent197fc75ab9850402b47d79da2e6cde47c8deb7d4 (diff)
downloadcproc-ab3187e9d02a9e4c3395c28858ac179d1fc5787b.tar.xz
expr: Include NUL-terminator in string expression data
This will facilitate the support of wide-string literals. Based on patch from Nihal Jere.
Diffstat (limited to 'test')
-rw-r--r--test/hello.qbe2
-rw-r--r--test/initializer-replace-local.qbe10
-rw-r--r--test/initializer-replace-static.qbe2
-rw-r--r--test/initializer-string-braces.qbe2
-rw-r--r--test/initializer-string.qbe2
-rw-r--r--test/initializer-unsigned-string.qbe2
6 files changed, 10 insertions, 10 deletions
diff --git a/test/hello.qbe b/test/hello.qbe
index 3e695ab..1826315 100644
--- a/test/hello.qbe
+++ b/test/hello.qbe
@@ -1,4 +1,4 @@
-data $.Lstring.2 = align 1 { b "hello", z 1, }
+data $.Lstring.2 = align 1 { b "hello\000", }
export
function w $main() {
@start.1
diff --git a/test/initializer-replace-local.qbe b/test/initializer-replace-local.qbe
index 72ad90a..316edb0 100644
--- a/test/initializer-replace-local.qbe
+++ b/test/initializer-replace-local.qbe
@@ -13,10 +13,10 @@ function $f() {
storeb 108, %.5
%.6 =l add %.1, 4
storeb 111, %.6
- %.7 =l add %.1, 1
- %.8 =w copy 97
- storeb %.8, %.7
- %.9 =l add %.1, 5
- storeb 0, %.9
+ %.7 =l add %.1, 5
+ storeb 0, %.7
+ %.8 =l add %.1, 1
+ %.9 =w copy 97
+ storeb %.9, %.8
ret
}
diff --git a/test/initializer-replace-static.qbe b/test/initializer-replace-static.qbe
index 18b774e..8d8f2cd 100644
--- a/test/initializer-replace-static.qbe
+++ b/test/initializer-replace-static.qbe
@@ -1 +1 @@
-export data $x = align 1 { b "hallo", z 1, }
+export data $x = align 1 { b "hallo\000", }
diff --git a/test/initializer-string-braces.qbe b/test/initializer-string-braces.qbe
index 46be123..5d44117 100644
--- a/test/initializer-string-braces.qbe
+++ b/test/initializer-string-braces.qbe
@@ -1 +1 @@
-export data $s = align 1 { b "abc", z 1, }
+export data $s = align 1 { b "abc\000", }
diff --git a/test/initializer-string.qbe b/test/initializer-string.qbe
index ba992da..ee83e50 100644
--- a/test/initializer-string.qbe
+++ b/test/initializer-string.qbe
@@ -1,4 +1,4 @@
-export data $x = align 1 { b "hello", z 1, }
+export data $x = align 1 { b "hello\000", }
export
function $f() {
@start.1
diff --git a/test/initializer-unsigned-string.qbe b/test/initializer-unsigned-string.qbe
index 46be123..5d44117 100644
--- a/test/initializer-unsigned-string.qbe
+++ b/test/initializer-unsigned-string.qbe
@@ -1 +1 @@
-export data $s = align 1 { b "abc", z 1, }
+export data $s = align 1 { b "abc\000", }