summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr20130-1.c
diff options
context:
space:
mode:
authorphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-11 03:18:56 +0000
committerphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-11 03:18:56 +0000
commit48854785d83ba49184295281e927c400d776c5d9 (patch)
tree2c71b62d1a54cb3df4ca245b02f729ad871db5e0 /gcc/testsuite/gcc.dg/pr20130-1.c
parentbf0ee60aba3bc52a02fc126a805f3e6c0f3cb3c0 (diff)
downloadgcc-48854785d83ba49184295281e927c400d776c5d9.tar.gz
2005-03-11 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/20130 * fold-const.c (fold): Fold x * -1 into -x. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr20130-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr20130-1.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr20130-1.c b/gcc/testsuite/gcc.dg/pr20130-1.c
new file mode 100644
index 00000000000..7097ff600eb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr20130-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-generic" } */
+int z (int a) {
+ return a * -1;
+}
+
+int x (int a) {
+ return -1 * a;
+}
+
+int y (int a) {
+ return -(-1 * -a);
+}
+/* { dg-final { scan-tree-dump-times "-a" 3 "generic" } } */