summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/builtin-copysign.c
blob: c20a0b6cb4934d1b169bb8ab4d9c99e66c8ed5a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O2" } */

#define TEST_SET(MODE, CEXT)						\
MODE test1##CEXT(MODE a) { return -a; }					\
MODE test2##CEXT(MODE a) { return __builtin_fabs##CEXT(a); }		\
MODE test3##CEXT(MODE a) { return __builtin_copysign##CEXT(a, 0.0); }	\
MODE test4##CEXT(MODE a) { return __builtin_copysign##CEXT(a, -1.0); }	\
MODE test5##CEXT(MODE a, MODE b) { return __builtin_copysign##CEXT(a, b); }

TEST_SET (float, f)
TEST_SET (double, )
TEST_SET (long double, l)
#if defined (__LP64__)
TEST_SET (__float128, q)
#endif