summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-plusmult.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/fold-plusmult.c')
-rw-r--r--gcc/testsuite/gcc.dg/fold-plusmult.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fold-plusmult.c b/gcc/testsuite/gcc.dg/fold-plusmult.c
new file mode 100644
index 000000000..d584b9588
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-plusmult.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int test1 (int a)
+{
+ return 2*a + 2*a;
+}
+
+int test2 (int a)
+{
+ return (a + a)*2;
+}
+
+/* { dg-final { scan-tree-dump-times "<a> \\\* 4" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */