Commit a938ab56 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque] add hex literals

Bug: v8:7793
Change-Id: I69e27cb1e8477ca0d64ad7a96ab256cae96339f4
Reviewed-on: https://chromium-review.googlesource.com/1086801Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53521}
parent 62b714e2
...@@ -116,6 +116,7 @@ DECIMAL_LITERAL ...@@ -116,6 +116,7 @@ DECIMAL_LITERAL
: MINUS? DECIMAL_INTEGER_LITERAL '.' DECIMAL_DIGIT* EXPONENT_PART? : MINUS? DECIMAL_INTEGER_LITERAL '.' DECIMAL_DIGIT* EXPONENT_PART?
| MINUS? '.' DECIMAL_DIGIT+ EXPONENT_PART? | MINUS? '.' DECIMAL_DIGIT+ EXPONENT_PART?
| MINUS? DECIMAL_INTEGER_LITERAL EXPONENT_PART? | MINUS? DECIMAL_INTEGER_LITERAL EXPONENT_PART?
| MINUS? '0x' [0-9a-fA-F]+
; ;
type : CONSTEXPR? IDENTIFIER type : CONSTEXPR? IDENTIFIER
......
This diff is collapsed.
...@@ -170,6 +170,18 @@ TEST(TestUnsafeCast) { ...@@ -170,6 +170,18 @@ TEST(TestUnsafeCast) {
ft.CheckCall(ft.true_value()); ft.CheckCall(ft.true_value());
} }
TEST(TestHexLiteral) {
Isolate* isolate(CcTest::InitIsolateOnce());
CodeAssemblerTester asm_tester(isolate, 0);
TestBuiltinsFromDSLAssembler m(asm_tester.state());
{
m.TestHexLiteral();
m.Return(m.UndefinedConstant());
}
FunctionTester ft(asm_tester.GenerateCode(), 0);
ft.Call();
}
} // namespace compiler } // namespace compiler
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -203,4 +203,9 @@ module test { ...@@ -203,4 +203,9 @@ module test {
} }
return False; return False;
} }
macro TestHexLiteral() {
check(convert<intptr>(0xffff) + 1 == 0x10000);
check(convert<intptr>(-0xffff) == -65535);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment