Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
ebd56317
Commit
ebd56317
authored
Jan 30, 2005
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR 19700 testcase.
From-SVN: r94443
parent
b99d6d2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
gcc/testsuite/gcc.c-torture/execute/ieee/copysign2.c
+40
-0
No files found.
gcc/testsuite/gcc.c-torture/execute/ieee/copysign2.c
0 → 100644
View file @
ebd56317
#include <string.h>
#include <stdlib.h>
#define TEST(TYPE, EXT) \
static TYPE Y##EXT[] = { \
2.0, -2.0, -2.0, -2.0, -2.0, 2.0, -0.0, __builtin_inf##EXT () \
}; \
static const TYPE Z##EXT[] = { \
1.0, -1.0, -1.0, -0.0, -0.0, 0.0, -__builtin_inf##EXT (), \
__builtin_nan##EXT ("") \
}; \
\
void test##EXT (void) \
{ \
TYPE r[8]; \
/* Make sure to avoid comparing unused bits in the type. */
\
memset (r, 0, sizeof r); \
r[0] = __builtin_copysign##EXT (1.0, Y##EXT[0]); \
r[1] = __builtin_copysign##EXT (1.0, Y##EXT[1]); \
r[2] = __builtin_copysign##EXT (-1.0, Y##EXT[2]); \
r[3] = __builtin_copysign##EXT (0.0, Y##EXT[3]); \
r[4] = __builtin_copysign##EXT (-0.0, Y##EXT[4]); \
r[5] = __builtin_copysign##EXT (-0.0, Y##EXT[5]); \
r[6] = __builtin_copysign##EXT (__builtin_inf##EXT (), Y##EXT[6]); \
r[7] = __builtin_copysign##EXT (-__builtin_nan##EXT (""), Y##EXT[7]); \
if (memcmp (r, Z##EXT, sizeof r) != 0) \
abort (); \
}
TEST
(
float
,
f
)
TEST
(
double
,
)
TEST
(
long
double
,
l
)
int
main
()
{
testf
();
test
();
testl
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment