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
eb5da24b
Commit
eb5da24b
authored
Jul 24, 2002
by
Richard Henderson
Committed by
Richard Henderson
Jul 24, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/execute/loop-2e.c: Rewrite for 64 bit and no mmap.
From-SVN: r55724
parent
8ad8135a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
47 deletions
+30
-47
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.c-torture/execute/loop-2e.c
+26
-47
No files found.
gcc/testsuite/ChangeLog
View file @
eb5da24b
2002-07-24 Richard Henderson <rth@redhat.com>
* gcc.c-torture/execute/loop-2e.c: Rewrite for 64 bit and no mmap.
2002-07-24 Gabriel Dos Reis <gdr@nerim.net>
* g++.dg/ext/alignof1.C (main): Return 0 for success.
...
...
gcc/testsuite/gcc.c-torture/execute/loop-2e.c
View file @
eb5da24b
#include <limits.h>
#ifdef __unix__
/* ??? Is that good enough? */
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef MAP_ANON
#ifdef MAP_ANONYMOUS
#define MAP_ANON MAP_ANONYMOUS
#else
#define MAP_ANON MAP_FILE
#endif
#endif
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
#ifndef MAP_FIXED
#define MAP_FIXED 0
#endif
#endif
#define MAP_START (void *)0x7fff8000
#define MAP_LEN 0x10000
#define OFFSET (MAP_LEN/2 - 2 * sizeof (int));
f
(
int
*
p
,
int
**
q
)
void
f
(
int
*
p
,
int
**
q
)
{
int
i
;
for
(
i
=
0
;
i
<
40
;
i
++
)
...
...
@@ -34,27 +7,33 @@ f (int *p, int **q)
}
}
main
()
int
main
()
{
#ifdef MAP_ANON
void
*
p
;
int
*
q
[
40
];
int
dev_zero
;
__SIZE_TYPE__
start
;
dev_zero
=
open
(
"/dev/zero"
,
O_RDONLY
);
/* -1 is OK when we have MAP_ANON; else mmap will flag an error. */
if
(
INT_MAX
!=
0x7fffffffL
||
sizeof
(
char
*
)
!=
sizeof
(
int
))
exit
(
0
);
p
=
mmap
(
MAP_START
,
MAP_LEN
,
PROT_READ
|
PROT_WRITE
,
MAP_ANON
|
MAP_FIXED
|
MAP_PRIVATE
,
dev_zero
,
0
);
if
(
p
!=
(
void
*
)
-
1
)
{
p
=
(
char
*
)
p
+
OFFSET
;
q
[
39
]
=
0
;
f
(
p
,
q
);
if
(
q
[
39
]
!=
(
int
*
)
p
+
39
)
abort
();
}
#endif
exit
(
0
);
/* Find the signed middle of the address space. */
if
(
sizeof
(
start
)
==
sizeof
(
int
))
start
=
(
__SIZE_TYPE__
)
__INT_MAX__
;
else
if
(
sizeof
(
start
)
==
sizeof
(
long
))
start
=
(
__SIZE_TYPE__
)
__LONG_MAX__
;
else
if
(
sizeof
(
start
)
==
sizeof
(
long
long
))
start
=
(
__SIZE_TYPE__
)
__LONG_LONG_MAX__
;
else
return
0
;
/* Arbitrarily align the pointer. */
start
&=
-
32
;
/* Pretend that's good enough to start address arithmetic. */
p
=
(
void
*
)
start
;
/* Verify that GIV replacement computes the correct results. */
q
[
39
]
=
0
;
f
(
p
,
q
);
if
(
q
[
39
]
!=
(
int
*
)
p
+
39
)
abort
();
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