aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/sizeof-compound-literal.c1
-rw-r--r--tests/sizeof-compound-literal.qbe1
-rw-r--r--tests/sizeof-postfix.c4
-rw-r--r--tests/sizeof-postfix.qbe8
4 files changed, 14 insertions, 0 deletions
diff --git a/tests/sizeof-compound-literal.c b/tests/sizeof-compound-literal.c
new file mode 100644
index 0000000..b25d06a
--- /dev/null
+++ b/tests/sizeof-compound-literal.c
@@ -0,0 +1 @@
+int x = sizeof (int){1};
diff --git a/tests/sizeof-compound-literal.qbe b/tests/sizeof-compound-literal.qbe
new file mode 100644
index 0000000..23be3d8
--- /dev/null
+++ b/tests/sizeof-compound-literal.qbe
@@ -0,0 +1 @@
+export data $x = align 4 { w 4, }
diff --git a/tests/sizeof-postfix.c b/tests/sizeof-postfix.c
new file mode 100644
index 0000000..9062517
--- /dev/null
+++ b/tests/sizeof-postfix.c
@@ -0,0 +1,4 @@
+int x;
+int f(void) {
+ return sizeof (x)++;
+}
diff --git a/tests/sizeof-postfix.qbe b/tests/sizeof-postfix.qbe
new file mode 100644
index 0000000..d9eedd8
--- /dev/null
+++ b/tests/sizeof-postfix.qbe
@@ -0,0 +1,8 @@
+export
+function w $f() {
+@start.1
+@body.2
+ %.1 =w copy 4
+ ret %.1
+}
+export data $x = align 4 { z 4 }