From 95c5e68714b006894ee532b8c76f128528848ffd Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Tue, 26 Feb 2013 10:49:59 +0000 Subject: [PATCH] Fix bogus regexp test. The reason this test fails on ARM hardware but not on Intel hardware (including the ARM simulator) is this: '\xa0' is interpreted as a negative signed byte number. Casting it to uc16 sign-extends it. The resulting string does not fit into a one-byte string, thus a two-byte string is allocated. For some reason the code compiled for ARM does not sign-extend, and 0xa0 fits into a one-byte string. Thus a one-byte string is allocated. Trying to cast it to two-byte causes assertion failure. BUG= Review URL: https://chromiumcodereview.appspot.com/12319111 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/cctest/test-regexp.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc index 083bbcc..1a65c06 100644 --- a/test/cctest/test-regexp.cc +++ b/test/cctest/test-regexp.cc @@ -861,7 +861,7 @@ TEST(MacroAssemblerNativeSimpleUC16) { int captures[4] = {42, 37, 87, 117}; const uc16 input_data[6] = {'f', 'o', 'o', 'f', 'o', - static_cast('\xa0')}; + static_cast(0x2603)}; Handle input = factory->NewStringFromTwoByte(Vector(input_data, 6)); Handle seq_input = Handle::cast(input); @@ -882,7 +882,7 @@ TEST(MacroAssemblerNativeSimpleUC16) { CHECK_EQ(-1, captures[3]); const uc16 input_data2[9] = {'b', 'a', 'r', 'b', 'a', 'r', 'b', 'a', - static_cast('\xa0')}; + static_cast(0x2603)}; input = factory->NewStringFromTwoByte(Vector(input_data2, 9)); seq_input = Handle::cast(input); start_adr = seq_input->GetCharsAddress(); -- 2.7.4