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
34eebd2a
Commit
34eebd2a
authored
Nov 13, 2013
by
Joseph Myers
Committed by
Joseph Myers
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.dg/c11-complex-1.c: New test.
From-SVN: r204732
parent
38b7bc7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.dg/c11-complex-1.c
+42
-0
No files found.
gcc/testsuite/ChangeLog
View file @
34eebd2a
2013-11-13 Joseph Myers <joseph@codesourcery.com>
2013-11-13 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-complex-1.c: New test.
2013-11-13 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/atomic/stdatomic-vm.c, gcc.dg/auto-type-1.c,
* gcc.dg/atomic/stdatomic-vm.c, gcc.dg/auto-type-1.c,
gcc.dg/auto-type-2.c: New tests.
gcc.dg/auto-type-2.c: New tests.
...
...
gcc/testsuite/gcc.dg/c11-complex-1.c
0 → 100644
View file @
34eebd2a
/* Test complex divide does not have the bug identified in N1496. */
/* { dg-do run } */
/* { dg-options "-std=c11 -pedantic-errors" } */
extern
void
abort
(
void
);
extern
void
exit
(
int
);
#define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y))
#define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y))
#define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y))
#define NAN __builtin_nanf ("")
#define isnan(x) __builtin_isnan (x)
volatile
_Complex
float
num_f
=
CMPLXF
(
1
,
1
);
volatile
_Complex
float
den_f
=
CMPLXF
(
0
,
NAN
);
volatile
_Complex
float
res_f
,
cres_f
=
CMPLXF
(
1
,
1
)
/
CMPLXF
(
0
,
NAN
);
volatile
_Complex
double
num_d
=
CMPLX
(
1
,
1
);
volatile
_Complex
double
den_d
=
CMPLX
(
0
,
NAN
);
volatile
_Complex
double
res_d
,
cres_d
=
CMPLX
(
1
,
1
)
/
CMPLX
(
0
,
NAN
);
volatile
_Complex
long
double
num_ld
=
CMPLXL
(
1
,
1
);
volatile
_Complex
long
double
den_ld
=
CMPLXL
(
0
,
NAN
);
volatile
_Complex
long
double
res_ld
,
cres_ld
=
CMPLXL
(
1
,
1
)
/
CMPLXL
(
0
,
NAN
);
int
main
(
void
)
{
res_f
=
num_f
/
den_f
;
if
(
!
isnan
(
__real__
res_f
)
||
!
isnan
(
__imag__
res_f
)
||
!
isnan
(
__real__
cres_f
)
||
!
isnan
(
__imag__
cres_f
))
abort
();
res_d
=
num_d
/
den_d
;
if
(
!
isnan
(
__real__
res_d
)
||
!
isnan
(
__imag__
res_d
)
||
!
isnan
(
__real__
cres_d
)
||
!
isnan
(
__imag__
cres_d
))
abort
();
res_ld
=
num_ld
/
den_ld
;
if
(
!
isnan
(
__real__
res_ld
)
||
!
isnan
(
__imag__
res_ld
)
||
!
isnan
(
__real__
cres_ld
)
||
!
isnan
(
__imag__
cres_ld
))
abort
();
exit
(
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