summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-24 20:00:09 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-24 20:00:09 +0000
commit189b339816238133988b6e976a05256f9d2d3426 (patch)
tree79896db4727874e5decda78a3b61216e7fcbce2f /gcc/testsuite
parenteb71604319e040a4a8aa8521159c342af0cc675c (diff)
downloadgcc-189b339816238133988b6e976a05256f9d2d3426.tar.gz
PR middle-end/19953
* builtins.c (fold_builtin_complex_mul, fold_builtin_complex_div): New. (fold_builtin_1): Call them. * fold-const.c (fold_complex_mult_parts): Split out from ... (fold_complex_mult): ... here. Fix typo in both imaginary case. (fold_complex_div_parts, fold_complex_div): New. (fold): Use them. * tree.h (fold_complex_mult_parts, fold_complex_div_parts): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95511 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/complex-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/complex-2.c12
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c b/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c
new file mode 100644
index 00000000000..7dff01ce425
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c
@@ -0,0 +1,12 @@
+/* Verify that we don't libcall for complex * real. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -O -fdump-tree-optimized" } */
+
+typedef _Complex float C;
+
+C foo(C x, float y)
+{
+ return x * y;
+}
+
+/* { dg-final { scan-tree-dump-times "__mul" 0 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c b/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c
new file mode 100644
index 00000000000..ce72eb2172f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c
@@ -0,0 +1,12 @@
+/* Verify that we don't libcall for complex / real. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -O -fdump-tree-optimized" } */
+
+typedef _Complex float C;
+
+C foo(C x, float y)
+{
+ return x / y;
+}
+
+/* { dg-final { scan-tree-dump-times "__div" 0 "optimized" } } */