summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/copy-sign-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/copy-sign-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/copy-sign-2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/copy-sign-2.c b/gcc/testsuite/gcc.dg/tree-ssa/copy-sign-2.c
new file mode 100644
index 00000000000..de52c5f7c80
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/copy-sign-2.c
@@ -0,0 +1,13 @@
+/* { dg-options "-O2 -ffast-math -fdump-tree-optimized" } */
+/* { dg-do compile } */
+float f(float x)
+{
+ float t = __builtin_copysignf (1.0f, x);
+ return x * t;
+}
+float f1(float x)
+{
+ float t = __builtin_copysignf (1.0f, -x);
+ return x * t;
+}
+/* { dg-final { scan-tree-dump-times "ABS" 2 "optimized"} } */