summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c
new file mode 100644
index 000000000..65aee7237
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+unsigned int
+foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d,
+ unsigned int e, unsigned int f, unsigned int g, unsigned int h)
+{
+ /* Should be transformed into e = 20 */
+ unsigned int i = (a + 9) + (c + 8);
+ unsigned int j = (-c + 1) + (-a + 2);
+
+ e = i + j;
+ return e;
+}
+
+/* { dg-final { scan-tree-dump-times "= 20" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */