Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2445)

Unified Diff: base/tools_sanity_unittest.cc

Issue 7931006: Prevent clang from optimizing away 2 variables. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tools_sanity_unittest.cc
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc
index 64a9ca68f1878431713960c7a2a41a95abacbfa2..661b58e44ec98f0c4fad0126ada8d6bb2c2fdc1c 100644
--- a/base/tools_sanity_unittest.cc
+++ b/base/tools_sanity_unittest.cc
@@ -84,7 +84,8 @@ TEST(ToolsSanityTest, ArrayDeletedWithoutBraces) {
if (!RunningOnValgrind())
return;
- int *foo = new int[10];
+ // Without the |volatile|, clang optimizes away the next two lines.
+ int* volatile foo = new int[10];
delete foo;
}
@@ -93,7 +94,8 @@ TEST(ToolsSanityTest, SingleElementDeletedWithBraces) {
if (!RunningOnValgrind())
return;
- int *foo = new int;
+ // Without the |volatile|, clang optimizes away the next two lines.
+ int* volatile foo = new int;
delete [] foo;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698