diff options
| author | 2018-07-13 10:27:43 +0100 | |
|---|---|---|
| committer | 2018-07-16 10:12:51 +0100 | |
| commit | 8e524ad3c690c183b1a71f6114796974a107c5dd (patch) | |
| tree | 6ee124814e8f33fd4706eb15fcad2cae0019546b /compiler/linker/linker_patch_test.cc | |
| parent | 5991b184a40e4ce181d67d683ced46caa6143b53 (diff) | |
Always produce PIC code for AOT compilation.
Change sharpening to use PIC load kinds for AOT compilation
and add "Jit" to the direct addressing load kind names. Use
PIC code also for the Integer.valueOf() intrinsic codegen.
Remove all support for non-PIC linker patches.
The dex2oat --compile-pic option is retained for now but
ignored by the compiler.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: testrunner.py --target --optimizing
Bug: 77856493
Change-Id: I54d666f6522f160a1b6ece4045a15d19363acbb6
Diffstat (limited to 'compiler/linker/linker_patch_test.cc')
| -rw-r--r-- | compiler/linker/linker_patch_test.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/linker/linker_patch_test.cc b/compiler/linker/linker_patch_test.cc index e87dc8de6b..997418c4f7 100644 --- a/compiler/linker/linker_patch_test.cc +++ b/compiler/linker/linker_patch_test.cc @@ -25,10 +25,14 @@ TEST(LinkerPatch, LinkerPatchOperators) { const DexFile* dex_file1 = reinterpret_cast<const DexFile*>(1); const DexFile* dex_file2 = reinterpret_cast<const DexFile*>(2); LinkerPatch patches[] = { + LinkerPatch::IntrinsicReferencePatch(16u, 3000u, 1000u), + LinkerPatch::IntrinsicReferencePatch(16u, 3001u, 1000u), + LinkerPatch::IntrinsicReferencePatch(16u, 3000u, 1001u), + LinkerPatch::IntrinsicReferencePatch(16u, 3001u, 1001u), LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3000u, 1000u), LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3001u, 1000u), LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3000u, 1001u), - LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3001u, 1001u), // Index 3. + LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3001u, 1001u), // Index 7. LinkerPatch::RelativeMethodPatch(16u, dex_file2, 3000u, 1000u), LinkerPatch::RelativeMethodPatch(16u, dex_file2, 3001u, 1000u), LinkerPatch::RelativeMethodPatch(16u, dex_file2, 3000u, 1001u), @@ -41,10 +45,6 @@ TEST(LinkerPatch, LinkerPatchOperators) { LinkerPatch::MethodBssEntryPatch(16u, dex_file2, 3001u, 1000u), LinkerPatch::MethodBssEntryPatch(16u, dex_file2, 3000u, 1001u), LinkerPatch::MethodBssEntryPatch(16u, dex_file2, 3001u, 1001u), - LinkerPatch::CodePatch(16u, dex_file1, 1000u), - LinkerPatch::CodePatch(16u, dex_file1, 1001u), - LinkerPatch::CodePatch(16u, dex_file2, 1000u), - LinkerPatch::CodePatch(16u, dex_file2, 1001u), LinkerPatch::RelativeCodePatch(16u, dex_file1, 1000u), LinkerPatch::RelativeCodePatch(16u, dex_file1, 1001u), LinkerPatch::RelativeCodePatch(16u, dex_file2, 1000u), @@ -86,6 +86,10 @@ TEST(LinkerPatch, LinkerPatchOperators) { LinkerPatch::BakerReadBarrierBranchPatch(16u, 1u, 0u), LinkerPatch::BakerReadBarrierBranchPatch(16u, 1u, 1u), + LinkerPatch::IntrinsicReferencePatch(32u, 3000u, 1000u), + LinkerPatch::IntrinsicReferencePatch(32u, 3001u, 1000u), + LinkerPatch::IntrinsicReferencePatch(32u, 3000u, 1001u), + LinkerPatch::IntrinsicReferencePatch(32u, 3001u, 1001u), LinkerPatch::RelativeMethodPatch(32u, dex_file1, 3000u, 1000u), LinkerPatch::RelativeMethodPatch(32u, dex_file1, 3001u, 1000u), LinkerPatch::RelativeMethodPatch(32u, dex_file1, 3000u, 1001u), @@ -102,10 +106,6 @@ TEST(LinkerPatch, LinkerPatchOperators) { LinkerPatch::MethodBssEntryPatch(32u, dex_file2, 3001u, 1000u), LinkerPatch::MethodBssEntryPatch(32u, dex_file2, 3000u, 1001u), LinkerPatch::MethodBssEntryPatch(32u, dex_file2, 3001u, 1001u), - LinkerPatch::CodePatch(32u, dex_file1, 1000u), - LinkerPatch::CodePatch(32u, dex_file1, 1001u), - LinkerPatch::CodePatch(32u, dex_file2, 1000u), - LinkerPatch::CodePatch(32u, dex_file2, 1001u), LinkerPatch::RelativeCodePatch(32u, dex_file1, 1000u), LinkerPatch::RelativeCodePatch(32u, dex_file1, 1001u), LinkerPatch::RelativeCodePatch(32u, dex_file2, 1000u), @@ -147,20 +147,20 @@ TEST(LinkerPatch, LinkerPatchOperators) { LinkerPatch::BakerReadBarrierBranchPatch(32u, 1u, 0u), LinkerPatch::BakerReadBarrierBranchPatch(32u, 1u, 1u), - LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3001u, 1001u), // Same as patch at index 3. + LinkerPatch::RelativeMethodPatch(16u, dex_file1, 3001u, 1001u), // Same as patch at index 7. }; constexpr size_t last_index = arraysize(patches) - 1u; for (size_t i = 0; i != arraysize(patches); ++i) { for (size_t j = 0; j != arraysize(patches); ++j) { - bool expected = (i != last_index ? i : 3u) == (j != last_index ? j : 3u); + bool expected = (i != last_index ? i : 7u) == (j != last_index ? j : 7u); EXPECT_EQ(expected, patches[i] == patches[j]) << i << " " << j; } } for (size_t i = 0; i != arraysize(patches); ++i) { for (size_t j = 0; j != arraysize(patches); ++j) { - bool expected = (i != last_index ? i : 3u) < (j != last_index ? j : 3u); + bool expected = (i != last_index ? i : 7u) < (j != last_index ? j : 7u); EXPECT_EQ(expected, patches[i] < patches[j]) << i << " " << j; } } |