aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2022-01-19 11:12:59 -0800
committerMichael Forney <mforney@mforney.org>2022-01-22 11:36:12 -0800
commit51e61fa5fa3de8cabc2191a5c6ac4d18aaaaf049 (patch)
tree8915d405a6f4aeadb28e06ace14d9459aa0b23b4 /test
parentd47ebf4c75615d1667a587d53dcd654e12ca6829 (diff)
Handle unary minus specially instead of 0 - x
This is necessary to fix unary negation of floating-point 0 (also depends on a pending qbe patch).
Diffstat (limited to 'test')
-rw-r--r--test/const-expr-neg.c1
-rw-r--r--test/const-expr-neg.qbe1
2 files changed, 2 insertions, 0 deletions
diff --git a/test/const-expr-neg.c b/test/const-expr-neg.c
new file mode 100644
index 0000000..0918aa9
--- /dev/null
+++ b/test/const-expr-neg.c
@@ -0,0 +1 @@
+double x = -0.0;
diff --git a/test/const-expr-neg.qbe b/test/const-expr-neg.qbe
new file mode 100644
index 0000000..b380795
--- /dev/null
+++ b/test/const-expr-neg.qbe
@@ -0,0 +1 @@
+export data $x = align 8 { d d_-0, }