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
7bf94db3
Commit
7bf94db3
authored
Feb 22, 2000
by
Mark Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add data member test
From-SVN: r32108
parent
fa2e34e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
+17
-3
No files found.
gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
View file @
7bf94db3
...
...
@@ -10,6 +10,7 @@
struct
S
{
int
i
;
int
j
;
};
// Because S does not have a VPTR, it will not be a primary base of T,
...
...
@@ -37,21 +38,23 @@ struct ptrmemfunc
ptrdiff_t
adj
;
};
typedef
int
S
::*
sdp
;
typedef
void
(
S
::*
sp
)();
typedef
void
(
T
::*
tp
)();
int
main
()
{
S
s
;
T
t
;
sp
x
;
tp
y
;
ptrmemfunc
*
xp
=
(
ptrmemfunc
*
)
&
x
;
ptrmemfunc
*
yp
=
(
ptrmemfunc
*
)
&
y
;
ptrdiff_t
delta
=
((
char
*
)
&
t
)
-
((
char
*
)
(
S
*
)
(
&
t
));
// Pointers-to-
members should have the same size and alignment as
// the PTRMEMFUNC type.
// Pointers-to-
function-members should have the same size and
//
alignment as
the PTRMEMFUNC type.
if
(
sizeof
(
sp
)
!=
sizeof
(
ptrmemfunc
))
return
1
;
if
(
__alignof__
(
sp
)
!=
__alignof__
(
ptrmemfunc
))
...
...
@@ -92,6 +95,17 @@ main ()
return
11
;
if
(
xp
->
adj
!=
delta
)
return
12
;
// Pointers-to-data-members should have the same size and alignment
// as a ptrdiff_t.
if
(
sizeof
(
sdp
)
!=
sizeof
(
ptrdiff_t
))
return
13
;
if
(
__alignof__
(
sdp
)
!=
__alignof__
(
ptrdiff_t
))
return
14
;
sdp
z
=
&
S
::
j
;
if
((
char
*
)
&
s
.
j
-
(
char
*
)
&
s
!=
*
((
ptrdiff_t
*
)
&
z
)
-
1
)
return
15
;
}
#else
/* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */
...
...
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