Index: test/cctest/interpreter/test-bytecode-generator.cc |
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc |
index 388ef0ef1292d3a0d8306b6ea867259c374c5442..c0a0df33998305b0da607b86b913027a8e3c3fad 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -220,8 +220,7 @@ TEST(PrimitiveExpressions) { |
B(Ldar), R(0), // |
B(Return) // |
}, |
- 0 |
- }, |
+ 0}, |
{"var x = 0; return x + 3;", |
2 * kPointerSize, |
1, |
@@ -235,8 +234,49 @@ TEST(PrimitiveExpressions) { |
B(Add), R(1), // |
B(Return) // |
}, |
- 0 |
- }}; |
+ 0}, |
+ {"var x = 10; return x << 3;", |
+ 2 * kPointerSize, |
+ 1, |
+ 13, |
+ { |
+ B(LdaSmi8), U8(10), // |
+ B(Star), R(0), // |
+ B(Ldar), R(0), // Easy to spot r1 not really needed here. |
+ B(Star), R(1), // Dead store. |
+ B(LdaSmi8), U8(3), // |
+ B(ShiftLeft), R(1), // |
+ B(Return) // |
+ }, |
+ 0}, |
+ {"var x = 10; return x >> 3;", |
+ 2 * kPointerSize, |
+ 1, |
+ 13, |
+ { |
+ B(LdaSmi8), U8(10), // |
+ B(Star), R(0), // |
+ B(Ldar), R(0), // Easy to spot r1 not really needed here. |
+ B(Star), R(1), // Dead store. |
+ B(LdaSmi8), U8(3), // |
+ B(ShiftRight), R(1), // |
+ B(Return) // |
+ }, |
+ 0}, |
+ {"var x = 10; return x >>> 3;", |
+ 2 * kPointerSize, |
+ 1, |
+ 13, |
+ { |
+ B(LdaSmi8), U8(10), // |
+ B(Star), R(0), // |
+ B(Ldar), R(0), // Easy to spot r1 not really needed here. |
+ B(Star), R(1), // Dead store. |
+ B(LdaSmi8), U8(3), // |
+ B(ShiftRightLogical), R(1), // |
+ B(Return) // |
+ }, |
+ 0}}; |
for (size_t i = 0; i < arraysize(snippets); i++) { |
Handle<BytecodeArray> bytecode_array = |