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
7bab4b90
Commit
7bab4b90
authored
May 17, 2006
by
Bernd Schmidt
Committed by
Bernd Schmidt
May 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp2.C: New test.
* g++.dg/opt/temp2.C: New test. From-SVN: r113851
parent
33598a1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/opt/temp2.C
+62
-0
No files found.
gcc/testsuite/ChangeLog
View file @
7bab4b90
2005
-
05
-
17
Bernd
Schmidt
<
bernd
.
schmidt
@analog
.
com
>
*
g
++
.
dg
/
opt
/
temp2
.
C
:
New
test
.
2006
-
05
-
17
Jakub
Jelinek
<
jakub
@redhat
.
com
>
PR
c
++/
27491
gcc/testsuite/g++.dg/opt/temp2.C
0 → 100644
View file @
7bab4b90
// { dg-do run }
// Copyright (C) 2006 Free Software Foundation, Inc.
// Originally from PR 16681, found also in init/array15.C
// This variant of the testcase verifies that we do not create
// a temporary on the stack, which is PR 27620.
int
i
;
extern
"C"
void
*
memcpy
(
void
*
dest
,
const
void
*
src
,
__SIZE_TYPE__
n
)
{
char
*
d
=
(
char
*
)
dest
;
const
char
*
s
=
(
const
char
*
)
src
;
while
(
n
--
)
d
[
n
]
=
s
[
n
];
++
i
;
return
dest
;
}
struct
foo
{
unsigned
char
buffer
[
41112
];
foo
()
;
bool
check
()
const
;
};
foo
::
foo
()
:
buffer
()
{}
bool
foo
::
check
()
const
{
for
(
unsigned
ix
=
sizeof
(
buffer
);
ix
--
;)
if
(
buffer
[
ix
])
return
false
;
return
true
;
}
void
*
operator
new
(
__SIZE_TYPE__
size
,
void
*
p
)
{
return
p
;
}
char
heap
[
50000
];
int
main
()
{
for
(
unsigned
ix
=
sizeof
(
heap
);
ix
--
;)
heap
[
ix
]
=
ix
;
i
=
0
;
foo
*
f
=
new
(
heap
)
foo
();
if
(
i
!=
0
)
return
1
;
if
(
!
f
->
check
())
return
1
;
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