diff options
author | Martin Jambor <mjambor@suse.cz> | 2017-08-14 14:33:54 +0000 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2017-08-14 14:33:54 +0000 |
commit | ae281588ac673801c2890f4679a211d24e4f8e01 (patch) | |
tree | ffda4ecce65bb72e54a07d8ed2c09288fa207b43 /gcc/testsuite/gcc.target/aarch64/xorsign_exec.c | |
parent | 7e05bab54f745defb749670b8c84eaf513c0b214 (diff) |
Merged trunk revision 251080 into the hsa branchhsa
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/hsa@251093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/xorsign_exec.c')
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/xorsign_exec.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/xorsign_exec.c b/gcc/testsuite/gcc.target/aarch64/xorsign_exec.c new file mode 100644 index 00000000000..64bf8044cbd --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/xorsign_exec.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-options "-O -ffast-math" } */ + +#include <math.h> + +extern void abort(void); + +static double x = 2.0; +static float y = 2.0; + +int main() +{ + if ((2.5 * __builtin_copysign(1.0d, x)) != 2.5) + abort(); + + if ((2.5 * __builtin_copysign(1.0f, y)) != 2.5) + abort(); + + if ((2.5 * __builtin_copysignf(1.0d, -x)) != -2.5) + abort(); + + if ((2.5 * __builtin_copysignf(1.0f, -y)) != -2.5) + abort(); + + return 0; +} |