Debian Codegraph @

gcc/testsuite/gcc.target/s390/vector/long-double-copysign.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -march=z14 -mzarch --save-temps" } */
3 /* { dg-do run { target { s390_z14_hw } } } */
4 #include <assert.h>
5 #include <stdint.h>
6
7 __attribute__ ((noipa)) static long double
8 long_double_copysign (long double x, long double y)
9 {
10 return __builtin_copysignl (x, y);
11 }
12
13 /* { dg-final { scan-assembler-times {\n\tvsel\t} 1 } } */
14
15 int
16 main (void)
17 {
18 assert (long_double_copysign (1.1L, 2.2L) == 1.1L);
19 assert (long_double_copysign (1.1L, -2.2L) == -1.1L);
20 assert (long_double_copysign (-1.1L, 2.2L) == 1.1L);
21 assert (long_double_copysign (-1.1L, -2.2L) == -1.1L);
22 }