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
b7fd6635
Commit
b7fd6635
authored
Oct 14, 1999
by
Stephane Carrez
Committed by
Jeff Law
Oct 14, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/execute/991014-1.c: New test.
From-SVN: r29970
parent
9180cca3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gcc.c-torture/execute/991014-1.c
+50
-0
No files found.
gcc/testsuite/ChangeLog
View file @
b7fd6635
Thu Oct 14 04:22:47 1999 Stephane Carrez <stcarrez@worldnet.fr>
* gcc.c-torture/execute/991014-1.c: New test.
Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* g++.old-deja/g++.other/union2.C: New test.
* g++.old-deja/g++.other/union2.C: New test.
...
...
gcc/testsuite/gcc.c-torture/execute/991014-1.c
0 → 100644
View file @
b7fd6635
typedef
typeof
(
sizeof
(
char
))
Size_t
;
#define bufsize ((1L << (8 * sizeof(Size_t) - 2))-256)
struct
huge_struct
{
short
buf
[
bufsize
];
int
a
;
int
b
;
int
c
;
int
d
;
};
union
huge_union
{
int
a
;
char
buf
[
bufsize
];
};
unsigned
long
union_size
()
{
return
sizeof
(
union
huge_union
);
}
unsigned
long
struct_size
()
{
return
sizeof
(
struct
huge_struct
);
}
unsigned
long
struct_a_offset
()
{
return
(
unsigned
long
)(
&
((
struct
huge_struct
*
)
0
)
->
a
);
}
int
main
()
{
/* Check the exact sizeof value. bufsize is aligned on 256b. */
if
(
union_size
()
!=
sizeof
(
char
)
*
bufsize
)
abort
();
if
(
struct_size
()
!=
sizeof
(
short
)
*
bufsize
+
4
*
sizeof
(
int
))
abort
();
if
(
struct_a_offset
()
<
sizeof
(
short
)
*
bufsize
)
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