summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/complex-7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/complex-7.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/complex-7.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/complex-7.c b/gcc/testsuite/gcc.dg/tree-ssa/complex-7.c
new file mode 100644
index 00000000000..20a2a3785f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/complex-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+float f(_Complex float x, _Complex float y){
+ x += y;
+ return __builtin_cimagf (x);
+}
+
+double g(double x){
+ _Complex double c = __builtin_cexpi (x);
+ return __builtin_creal (c);
+}
+
+/* { dg-final { scan-tree-dump "__builtin_cos" "forwprop1"} } */
+/* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 2 "forwprop1"} } */