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
a5326b13
Commit
a5326b13
authored
Oct 24, 2006
by
Kaveh R. Ghazi
Committed by
Kaveh Ghazi
Oct 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builtin-math-2.c: New test.
* gcc.dg/torture/builtin-math-2.c: New test. From-SVN: r118003
parent
27d7d042
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.dg/torture/builtin-math-2.c
+67
-0
No files found.
gcc/testsuite/ChangeLog
View file @
a5326b13
2006
-
10
-
24
Kaveh
R
.
Ghazi
<
ghazi
@caip
.
rutgers
.
edu
>
*
gcc
.
dg
/
torture
/
builtin
-
math
-
2
.
c
:
New
test
.
2006
-
10
-
24
Richard
Guenther
<
rguenther
@suse
.
de
>
2006
-
10
-
24
Richard
Guenther
<
rguenther
@suse
.
de
>
PR
middle
-
end
/
28796
PR
middle
-
end
/
28796
gcc/testsuite/gcc.dg/torture/builtin-math-2.c
0 → 100644
View file @
a5326b13
/* Test things that should block GCC from optimizing compile-time
constants passed to a builtin transcendental function.
Origin: Kaveh R. Ghazi 10/22/2006. */
/* { dg-do compile } */
/* { dg-options "-fdump-tree-original" } */
extern
void
foof
(
float
);
extern
void
foo
(
double
);
extern
void
fool
(
long
double
);
void
bar
()
{
/* An argument of NaN is not evaluated at compile-time. */
foof
(
__builtin_exp2f
(
__builtin_nanf
(
""
)));
foo
(
__builtin_exp2
(
__builtin_nan
(
""
)));
fool
(
__builtin_exp2l
(
__builtin_nanl
(
""
)));
/* An argument of Inf/-Inf is not evaluated at compile-time. */
foof
(
__builtin_exp2f
(
__builtin_inff
()));
foo
(
__builtin_exp2
(
__builtin_inf
()));
fool
(
__builtin_exp2l
(
__builtin_infl
()));
foof
(
__builtin_exp2f
(
-
__builtin_inff
()));
foo
(
__builtin_exp2
(
-
__builtin_inf
()));
fool
(
__builtin_exp2l
(
-
__builtin_infl
()));
/* Result overflows MPFR, which in version 2.2.x has 30 exponent bits. */
foof
(
__builtin_exp2f
(
0x1
p50F
));
foo
(
__builtin_exp2
(
0x1
p50
));
fool
(
__builtin_exp2l
(
0x1
p50L
));
/* Result underflows MPFR, which in version 2.2.x has 30 exponent bits. */
foof
(
__builtin_exp2f
(
-
0x1
p50F
));
foo
(
__builtin_exp2
(
-
0x1
p50
));
fool
(
__builtin_exp2l
(
-
0x1
p50L
));
/* Result overflows GCC's REAL_VALUE_TYPE, which has 26 exponent bits. */
foof
(
__builtin_exp2f
(
0x1
p28F
));
foo
(
__builtin_exp2
(
0x1
p28
));
fool
(
__builtin_exp2l
(
0x1
p28L
));
/* Result underflows GCC's REAL_VALUE_TYPE, which has 26 exponent bits. */
foof
(
__builtin_exp2f
(
-
0x1
p28F
));
foo
(
__builtin_exp2
(
-
0x1
p28
));
fool
(
__builtin_exp2l
(
-
0x1
p28L
));
/* Result overflows (even an extended) C double's mode. */
foof
(
__builtin_exp2f
(
0x1
p24F
));
foo
(
__builtin_exp2
(
0x1
p24
));
fool
(
__builtin_exp2l
(
0x1
p24L
));
/* Result underflows (even an extended) C double's mode. */
foof
(
__builtin_exp2f
(
-
0x1
p24F
));
foo
(
__builtin_exp2
(
-
0x1
p24
));
fool
(
__builtin_exp2l
(
-
0x1
p24L
));
/* Ensure that normal arguments/results are folded. */
foof
(
__builtin_exp2f
(
1
.
5
F
));
foo
(
__builtin_exp2
(
1
.
5
));
fool
(
__builtin_exp2l
(
1
.
5L
));
foof
(
__builtin_exp2f
(
-
1
.
5
F
));
foo
(
__builtin_exp2
(
-
1
.
5
));
fool
(
__builtin_exp2l
(
-
1
.
5L
));
}
/* { dg-final { scan-tree-dump-times "exp2 " 9 "original" } } */
/* { dg-final { scan-tree-dump-times "exp2f" 9 "original" } } */
/* { dg-final { scan-tree-dump-times "exp2l" 9 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */
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