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

Unified Diff: test/cctest/compiler/test-run-properties.cc

Issue 576973003: Hack representation inference to assume current behavior of float32 loads and stores, which include… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
Index: test/cctest/compiler/test-run-properties.cc
diff --git a/test/cctest/compiler/test-run-properties.cc b/test/cctest/compiler/test-run-properties.cc
index b1f04c51c2860d75927234b76e0896d04b9bd718..d4442f7a85d6ddfc6f295b3c9e8ba1e087bd350d 100644
--- a/test/cctest/compiler/test-run-properties.cc
+++ b/test/cctest/compiler/test-run-properties.cc
@@ -47,9 +47,10 @@ static void TypedArrayLoadHelper(const char* array_type) {
CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled);
for (size_t i = 0; i < arraysize(kValues); ++i) {
for (size_t j = 0; j < arraysize(kValues); ++j) {
- double value_a = static_cast<U>(kValues[i]);
- double value_b = static_cast<U>(kValues[j]);
- double expected = value_a + value_b;
+ volatile U value_a = static_cast<U>(kValues[i]);
Michael Starzinger 2014/09/18 18:38:07 Man, do I love C++ intuitiveness. :)
+ volatile U value_b = static_cast<U>(kValues[j]);
+ double expected =
+ static_cast<double>(value_a) + static_cast<double>(value_b);
Sven Panne 2014/09/19 06:07:26 Casting away volatile leads to undefined behavior:
T.CheckCall(T.Val(expected), T.Val(static_cast<double>(i)),
T.Val(static_cast<double>(j)));
}
@@ -65,8 +66,8 @@ TEST(TypedArrayLoad) {
TypedArrayLoadHelper<uint16_t>("Uint16");
TypedArrayLoadHelper<int32_t>("Int32");
TypedArrayLoadHelper<uint32_t>("Uint32");
+ TypedArrayLoadHelper<float>("Float32");
TypedArrayLoadHelper<double>("Float64");
- // TODO(mstarzinger): Add tests for Float32.
// TODO(mstarzinger): Add tests for ClampedUint8.
}
@@ -115,9 +116,10 @@ static void TypedArrayStoreHelper(const char* array_type) {
CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled);
for (size_t i = 0; i < arraysize(kValues); ++i) {
for (size_t j = 0; j < arraysize(kValues); ++j) {
- double value_a = static_cast<U>(kValues[i]);
- double value_b = static_cast<U>(kValues[j]);
- double expected = value_b + value_a;
+ volatile U value_a = static_cast<U>(kValues[i]);
+ volatile U value_b = static_cast<U>(kValues[j]);
+ double expected =
+ static_cast<double>(value_a) + static_cast<double>(value_b);
T.CheckCall(T.Val(expected), T.Val(static_cast<double>(i)),
T.Val(static_cast<double>(j)));
}
@@ -133,7 +135,7 @@ TEST(TypedArrayStore) {
TypedArrayStoreHelper<uint16_t>("Uint16");
TypedArrayStoreHelper<int32_t>("Int32");
TypedArrayStoreHelper<uint32_t>("Uint32");
+ TypedArrayStoreHelper<float>("Float32");
TypedArrayStoreHelper<double>("Float64");
- // TODO(mstarzinger): Add tests for Float32.
// TODO(mstarzinger): Add tests for ClampedUint8.
}
« no previous file with comments | « test/cctest/compiler/test-representation-change.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698