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
03c53278
Commit
03c53278
authored
Jul 01, 2002
by
J"orn Rennecke
Committed by
Joern Rennecke
Jul 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/execute/arith-rand-ll.c: New test.
From-SVN: r55136
parent
e34cabb3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
0 deletions
+118
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c
+114
-0
No files found.
gcc/testsuite/ChangeLog
View file @
03c53278
Mon Jul 1 12:51:05 2002 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.c-torture/execute/arith-rand-ll.c: New test.
2002-07-01 Neil Booth <neil@daikokuya.co.uk>
2002-07-01 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/trad/escaped-nl.c: New test.
* gcc.dg/cpp/trad/escaped-nl.c: New test.
...
...
gcc/testsuite/gcc.c-torture/execute/arith-rand-ll.c
0 → 100644
View file @
03c53278
long
long
simple_rand
()
{
static
unsigned
long
long
seed
=
47114711
;
unsigned
long
long
this
=
seed
*
1103515245
+
12345
;
seed
=
this
;
return
this
>>
8
;
}
unsigned
long
long
int
random_bitstring
()
{
unsigned
long
long
int
x
;
int
n_bits
;
long
long
ran
;
int
tot_bits
=
0
;
x
=
0
;
for
(;;)
{
ran
=
simple_rand
();
n_bits
=
(
ran
>>
1
)
%
16
;
tot_bits
+=
n_bits
;
if
(
n_bits
==
0
)
return
x
;
else
{
x
<<=
n_bits
;
if
(
ran
&
1
)
x
|=
(
1
<<
n_bits
)
-
1
;
if
(
tot_bits
>
8
*
sizeof
(
long
long
)
+
6
)
return
x
;
}
}
}
#define ABS(x) ((x) >= 0 ? (x) : -(x))
main
()
{
long
long
int
i
;
for
(
i
=
0
;
i
<
10000
;
i
++
)
{
unsigned
long
long
x
,
y
;
x
=
random_bitstring
();
y
=
random_bitstring
();
if
(
sizeof
(
int
)
==
sizeof
(
long
long
))
goto
save_time
;
{
unsigned
long
long
xx
=
x
,
yy
=
y
,
r1
,
r2
;
if
(
yy
==
0
)
continue
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
r2
>=
yy
||
r1
*
yy
+
r2
!=
xx
)
abort
();
}
{
signed
long
long
xx
=
x
,
yy
=
y
,
r1
,
r2
;
if
((
unsigned
long
long
)
xx
<<
1
==
0
&&
yy
==
-
1
)
continue
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
ABS
(
r2
)
>=
(
unsigned
long
long
)
ABS
(
yy
)
||
(
signed
long
long
)
(
r1
*
yy
+
r2
)
!=
xx
)
abort
();
}
save_time
:
{
unsigned
int
xx
=
x
,
yy
=
y
,
r1
,
r2
;
if
(
yy
==
0
)
continue
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
r2
>=
yy
||
r1
*
yy
+
r2
!=
xx
)
abort
();
}
{
signed
int
xx
=
x
,
yy
=
y
,
r1
,
r2
;
if
((
unsigned
int
)
xx
<<
1
==
0
&&
yy
==
-
1
)
continue
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
ABS
(
r2
)
>=
(
unsigned
int
)
ABS
(
yy
)
||
(
signed
int
)
(
r1
*
yy
+
r2
)
!=
xx
)
abort
();
}
{
unsigned
short
xx
=
x
,
yy
=
y
,
r1
,
r2
;
if
(
yy
==
0
)
continue
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
r2
>=
yy
||
r1
*
yy
+
r2
!=
xx
)
abort
();
}
{
signed
short
xx
=
x
,
yy
=
y
,
r1
,
r2
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
ABS
(
r2
)
>=
(
unsigned
short
)
ABS
(
yy
)
||
(
signed
short
)
(
r1
*
yy
+
r2
)
!=
xx
)
abort
();
}
{
unsigned
char
xx
=
x
,
yy
=
y
,
r1
,
r2
;
if
(
yy
==
0
)
continue
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
r2
>=
yy
||
r1
*
yy
+
r2
!=
xx
)
abort
();
}
{
signed
char
xx
=
x
,
yy
=
y
,
r1
,
r2
;
r1
=
xx
/
yy
;
r2
=
xx
%
yy
;
if
(
ABS
(
r2
)
>=
(
unsigned
char
)
ABS
(
yy
)
||
(
signed
char
)
(
r1
*
yy
+
r2
)
!=
xx
)
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