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

Unified Diff: src/compiler/common-operator-unittest.cc

Issue 594493002: [turbofan] Add operators for float32 support. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/graph-unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator-unittest.cc
diff --git a/src/compiler/common-operator-unittest.cc b/src/compiler/common-operator-unittest.cc
index 128f8ddede541c214f4dfd3779f19c5abf445293..5001770ddf1347c772e9bc7d2b44424f69f24fd7 100644
--- a/src/compiler/common-operator-unittest.cc
+++ b/src/compiler/common-operator-unittest.cc
@@ -4,6 +4,8 @@
#include "src/compiler/common-operator.h"
+#include <limits>
+
#include "src/compiler/operator-properties-inl.h"
#include "src/test/test-utils.h"
@@ -132,9 +134,26 @@ class CommonOperatorTest : public TestWithZone {
const int kArguments[] = {1, 5, 6, 42, 100, 10000, kMaxInt};
+const float kFloat32Values[] = {
+ std::numeric_limits<float>::min(), -1.0f, -0.0f, 0.0f, 1.0f,
+ std::numeric_limits<float>::max()};
+
} // namespace
+TEST_F(CommonOperatorTest, Float32Constant) {
+ TRACED_FOREACH(float, value, kFloat32Values) {
+ const Operator* op = common()->Float32Constant(value);
+ EXPECT_FLOAT_EQ(value, OpParameter<float>(op));
+ EXPECT_EQ(0, OperatorProperties::GetValueInputCount(op));
+ EXPECT_EQ(0, OperatorProperties::GetTotalInputCount(op));
+ EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
+ EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op));
+ EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
+ }
+}
+
+
TEST_F(CommonOperatorTest, ValueEffect) {
TRACED_FOREACH(int, arguments, kArguments) {
const Operator* op = common()->ValueEffect(arguments);
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/graph-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698