Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
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
Chen Yisong
googletest
Commits
c006f8c1
Commit
c006f8c1
authored
Apr 14, 2011
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes a problem caused by gcc 4.6 optimization (by Paul Pluzhnikov)
parent
6a5a25b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
gtest-port.h
include/gtest/internal/gtest-port.h
+7
-0
gtest-death-test.cc
src/gtest-death-test.cc
+5
-0
No files found.
include/gtest/internal/gtest-port.h
View file @
c006f8c1
...
...
@@ -662,6 +662,13 @@
# define GTEST_API_
#endif
#if defined(__GNUC__)
// Ask the compiler to never inline a given function.
#define GTEST_NO_INLINE_ __attribute__((noinline))
#else
#define GTEST_NO_INLINE_
#endif // __GNUC__
namespace
testing
{
class
Message
;
...
...
src/gtest-death-test.cc
View file @
c006f8c1
...
...
@@ -932,6 +932,11 @@ static int ExecDeathTestChildMain(void* child_arg) {
// This could be accomplished more elegantly by a single recursive
// function, but we want to guard against the unlikely possibility of
// a smart compiler optimizing the recursion away.
//
// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
// StackLowerThanAddress into StackGrowsDown, which then doesn't give
// correct answer.
bool
StackLowerThanAddress
(
const
void
*
ptr
)
GTEST_NO_INLINE_
;
bool
StackLowerThanAddress
(
const
void
*
ptr
)
{
int
dummy
;
return
&
dummy
<
ptr
;
...
...
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