aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-sub.c
diff options
context:
space:
mode:
authorChristian Bruel <christian.bruel@st.com>2007-08-22 16:38:16 +0200
committerChristian Bruel <chrbr@gcc.gnu.org>2007-08-22 16:38:16 +0200
commit81d2fb0294c4804ec559bb6f796fb8c79bea06a2 (patch)
treee4a372adecd095b7b82017b726220ef5440be287 /gcc/testsuite/gcc.dg/fold-sub.c
parentfcdb5d68deffd7e82c3362e210e64dec78a66d62 (diff)
downloadgcc-81d2fb0294c4804ec559bb6f796fb8c79bea06a2.zip
gcc-81d2fb0294c4804ec559bb6f796fb8c79bea06a2.tar.gz
gcc-81d2fb0294c4804ec559bb6f796fb8c79bea06a2.tar.bz2
fixed -ffinite-math-only A-A missing optimisation
Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r127705
Diffstat (limited to 'gcc/testsuite/gcc.dg/fold-sub.c')
-rw-r--r--gcc/testsuite/gcc.dg/fold-sub.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fold-sub.c b/gcc/testsuite/gcc.dg/fold-sub.c
new file mode 100644
index 0000000..28a8dd5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-sub.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-ffinite-math-only -fdump-tree-gimple" } */
+
+float f(float x)
+{
+ return x - x;
+}
+
+/* Substraction should be turned into 0. */
+
+/* { dg-final { scan-tree-dump-not " - " "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */