aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-01-31 13:41:04 -0800
committerMichael Forney <mforney@mforney.org>2020-01-31 13:41:04 -0800
commit8e47cf45dfed44627fa6f73f8734f2149c661044 (patch)
treefccff3d04878d23e441712ccab04a9202d31924e /test
parent41e862a6a2b193b6bab86bc29e2db3d42baa828a (diff)
eval: Allow casting address constants to integer types in constant expressions
Diffstat (limited to 'test')
-rw-r--r--test/initializer-pointer-int-cast.c2
-rw-r--r--test/initializer-pointer-int-cast.qbe2
2 files changed, 4 insertions, 0 deletions
diff --git a/test/initializer-pointer-int-cast.c b/test/initializer-pointer-int-cast.c
new file mode 100644
index 0000000..75963b2
--- /dev/null
+++ b/test/initializer-pointer-int-cast.c
@@ -0,0 +1,2 @@
+int x;
+long p = (long)&x;
diff --git a/test/initializer-pointer-int-cast.qbe b/test/initializer-pointer-int-cast.qbe
new file mode 100644
index 0000000..a996882
--- /dev/null
+++ b/test/initializer-pointer-int-cast.qbe
@@ -0,0 +1,2 @@
+export data $p = align 8 { l $x, }
+export data $x = align 4 { z 4 }