diff options
author | Roland Levillain <rpl@google.com> | 2014-11-11 17:35:19 +0000 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2014-11-11 17:35:19 +0000 |
commit | 946e143941d456a4ec666f7f54719c65c5aa3f5d (patch) | |
tree | 4535eb320a60043b18735a8496a288f6f8377cb7 /compiler/optimizing/codegen_test.cc | |
parent | d6425d7bb909b668341d9781c567f35f6d10ea16 (diff) |
Revert "Revert "Add support for long-to-int in the optimizing compiler.""
This reverts commit 3adfd1b4fb20ac2b0217b5d2737bfe30ad90257a.
Change-Id: Iacf0c6492d49267e24f1b727dbf6379b21fd02db
Diffstat (limited to 'compiler/optimizing/codegen_test.cc')
-rw-r--r-- | compiler/optimizing/codegen_test.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index ecee44392e..9752b1d34b 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -362,6 +362,27 @@ NOT_LONG_TEST(ReturnNotLongINT64_MAX, #undef NOT_LONG_TEST +#if defined(__aarch64__) +TEST(CodegenTest, DISABLED_IntToLongOfLongToInt) { +#else +TEST(CodegenTest, IntToLongOfLongToInt) { +#endif + const int64_t input = INT64_C(4294967296); // 2^32 + const uint16_t word0 = Low16Bits(Low32Bits(input)); // LSW. + const uint16_t word1 = High16Bits(Low32Bits(input)); + const uint16_t word2 = Low16Bits(High32Bits(input)); + const uint16_t word3 = High16Bits(High32Bits(input)); // MSW. + const uint16_t data[] = FIVE_REGISTERS_CODE_ITEM( + Instruction::CONST_WIDE | 0 << 8, word0, word1, word2, word3, + Instruction::CONST_WIDE | 2 << 8, 1, 0, 0, 0, + Instruction::ADD_LONG | 0, 0 << 8 | 2, // v0 <- 2^32 + 1 + Instruction::LONG_TO_INT | 4 << 8 | 0 << 12, + Instruction::INT_TO_LONG | 2 << 8 | 4 << 12, + Instruction::RETURN_WIDE | 2 << 8); + + TestCodeLong(data, true, 1); +} + TEST(CodegenTest, ReturnAdd1) { const uint16_t data[] = TWO_REGISTERS_CODE_ITEM( Instruction::CONST_4 | 3 << 12 | 0, |