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

Unified Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 1491223002: [turbofan] Desugar JSUnaryNot(x) to Select(x, false, true). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo in arm64. Created 5 years 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 | « test/unittests/compiler/js-operator-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/js-typed-lowering-unittest.cc
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
index aa1bf558f6c385cd8149bde98b7adfb2b0a9609a..a92a68c5826a143840cffbe679e0ca8134af7de6 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -124,106 +124,6 @@ class JSTypedLoweringTest : public TypedGraphTest {
// -----------------------------------------------------------------------------
-// JSUnaryNot
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithBoolean) {
- Node* input = Parameter(Type::Boolean(), 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsBooleanNot(input));
-}
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithOrderedNumber) {
- Node* input = Parameter(Type::OrderedNumber(), 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsNumberEqual(input, IsNumberConstant(0)));
-}
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithFalsish) {
- Node* input = Parameter(
- Type::Union(
- Type::MinusZero(),
- Type::Union(
- Type::NaN(),
- Type::Union(
- Type::Null(),
- Type::Union(
- Type::Undefined(),
- Type::Union(
- Type::Undetectable(),
- Type::Union(
- Type::Constant(factory()->false_value(), zone()),
- Type::Range(0.0, 0.0, zone()), zone()),
- zone()),
- zone()),
- zone()),
- zone()),
- zone()),
- 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsTrueConstant());
-}
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithTruish) {
- Node* input = Parameter(
- Type::Union(
- Type::Constant(factory()->true_value(), zone()),
- Type::Union(Type::DetectableReceiver(), Type::Symbol(), zone()),
- zone()),
- 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsFalseConstant());
-}
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithNonZeroPlainNumber) {
- Node* input = Parameter(Type::Range(1.0, 42.0, zone()), 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsFalseConstant());
-}
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithString) {
- Node* input = Parameter(Type::String(), 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsNumberEqual(IsLoadField(AccessBuilder::ForStringLength(), input,
- graph()->start(), graph()->start()),
- IsNumberConstant(0.0)));
-}
-
-
-TEST_F(JSTypedLoweringTest, JSUnaryNotWithAny) {
- Node* input = Parameter(Type::Any(), 0);
- Node* context = Parameter(Type::Any(), 1);
- Reduction r = Reduce(graph()->NewNode(javascript()->UnaryNot(), input,
- context, graph()->start()));
- ASSERT_FALSE(r.Changed());
-}
-
-
-// -----------------------------------------------------------------------------
// Constant propagation
« no previous file with comments | « test/unittests/compiler/js-operator-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698