From 51e61fa5fa3de8cabc2191a5c6ac4d18aaaaf049 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 19 Jan 2022 11:12:59 -0800 Subject: 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). --- test/const-expr-neg.c | 1 + test/const-expr-neg.qbe | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/const-expr-neg.c create mode 100644 test/const-expr-neg.qbe (limited to 'test') 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, } -- cgit v1.2.3