blob: 64bf8044cbd12c1cc744ff9b2a3308d71267bff0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
}
|