From abab0dbde233d33af5f815e04a8313e7593797a3 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 28 Sep 2021 13:13:57 -0700 Subject: [PATCH] [llvm-jitlink] Add -slab-page-size to tests that need it. Also fixes 80-column rule violations. --- .../ExecutionEngine/JITLink/RISCV/ELF_abs_reloc.s | 18 ++++++++++++------ .../ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s | 20 ++++++++++++-------- .../JITLink/RISCV/ELF_riscv32_got_plt_reloc.s | 11 ++++++----- .../JITLink/RISCV/ELF_riscv64_got_plt_reloc.s | 10 ++++++---- .../JITLink/X86/ELF_x86-64_got_plt_optimizations.s | 11 ++++++----- .../JITLink/X86/ELF_x86-64_large_pic_relocations.s | 9 +++++---- .../JITLink/X86/ELF_x86-64_small_pic_relocations.s | 13 +++++++------ .../JITLink/X86/ELF_x86_64_absolute_relocations.s | 13 +++++++------ .../JITLink/X86/MachO_GOTAndStubsOptimization.s | 8 ++++---- .../JITLink/X86/MachO_x86-64_relocations.s | 3 ++- 10 files changed, 67 insertions(+), 49 deletions(-) diff --git a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_abs_reloc.s b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_abs_reloc.s index a70a8b8..148764d 100644 --- a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_abs_reloc.s +++ b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_abs_reloc.s @@ -1,10 +1,16 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t/elf_riscv64_non_pc_indirect_reloc.o %s -# RUN: llvm-mc -triple=riscv32 -filetype=obj -o %t/elf_riscv32_non_pc_indirect_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 -define-abs external_data=0xfff10000\ -# RUN: -check %s %t/elf_riscv64_non_pc_indirect_reloc.o -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 -define-abs external_data=0xfff10000\ -# RUN: -check %s %t/elf_riscv32_non_pc_indirect_reloc.o +# RUN: llvm-mc -triple=riscv64 -filetype=obj \ +# RUN: -o %t/elf_riscv64_non_pc_indirect_reloc.o %s +# RUN: llvm-mc -triple=riscv32 -filetype=obj \ +# RUN: -o %t/elf_riscv32_non_pc_indirect_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_data=0xfff10000 \ +# RUN: -check %s %t/elf_riscv64_non_pc_indirect_reloc.o +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_data=0xfff10000 \ +# RUN: -check %s %t/elf_riscv32_non_pc_indirect_reloc.o # .text diff --git a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s index 25ae81f..539da2b 100644 --- a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s +++ b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_pc_indirect.s @@ -1,12 +1,16 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=riscv64 -position-independent -filetype=obj -o %t/elf_riscv64_sm_pic_reloc.o %s -# RUN: llvm-mc -triple=riscv32 -position-independent -filetype=obj -o %t/elf_riscv32_sm_pic_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ -# RUN: -check %s %t/elf_riscv64_sm_pic_reloc.o -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000\ -# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ -# RUN: -check %s %t/elf_riscv32_sm_pic_reloc.o +# RUN: llvm-mc -triple=riscv64 -position-independent -filetype=obj \ +# RUN: -o %t/elf_riscv64_sm_pic_reloc.o %s +# RUN: llvm-mc -triple=riscv32 -position-independent -filetype=obj \ +# RUN: -o %t/elf_riscv32_sm_pic_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ +# RUN: -check %s %t/elf_riscv64_sm_pic_reloc.o +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ +# RUN: -check %s %t/elf_riscv32_sm_pic_reloc.o # # Test ELF small/PIC relocations diff --git a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv32_got_plt_reloc.s b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv32_got_plt_reloc.s index d9c7142..c8df485 100644 --- a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv32_got_plt_reloc.s +++ b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv32_got_plt_reloc.s @@ -1,9 +1,10 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=riscv32 -position-independent -filetype=obj -o %t/elf_riscv32_got_plt_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ -# RUN: -check %s %t/elf_riscv32_got_plt_reloc.o - +# RUN: llvm-mc -triple=riscv32 -position-independent -filetype=obj \ +# RUN: -o %t/elf_riscv32_got_plt_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ +# RUN: -check %s %t/elf_riscv32_got_plt_reloc.o .text .file "testcase.c" diff --git a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv64_got_plt_reloc.s b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv64_got_plt_reloc.s index 141ef9f..e5b789d 100644 --- a/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv64_got_plt_reloc.s +++ b/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_riscv64_got_plt_reloc.s @@ -1,8 +1,10 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=riscv64 -position-independent -filetype=obj -o %t/elf_riscv64_got_plt_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ -# RUN: -check %s %t/elf_riscv64_got_plt_reloc.o +# RUN: llvm-mc -triple=riscv64 -position-independent -filetype=obj \ +# RUN: -o %t/elf_riscv64_got_plt_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_func=0x1 -define-abs external_data=0x2 \ +# RUN: -check %s %t/elf_riscv64_got_plt_reloc.o .text diff --git a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_got_plt_optimizations.s b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_got_plt_optimizations.s index d74c56a..6090cc9 100644 --- a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_got_plt_optimizations.s +++ b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_got_plt_optimizations.s @@ -1,9 +1,10 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj \ -# RUN: -o %t/elf_sm_pic_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -define-abs extern_in_range32=0xffe00000 \ -# RUN: -check %s %t/elf_sm_pic_reloc.o +# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \ +# RUN: -filetype=obj -o %t/elf_sm_pic_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs extern_in_range32=0xffe00000 \ +# RUN: -check %s %t/elf_sm_pic_reloc.o # diff --git a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_large_pic_relocations.s b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_large_pic_relocations.s index b70debd..5db85b6 100644 --- a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_large_pic_relocations.s +++ b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_large_pic_relocations.s @@ -1,8 +1,9 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj \ -# RUN: -large-code-model -o %t/elf_lg_pic_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -check %s %t/elf_lg_pic_reloc.o +# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \ +# RUN: -filetype=obj -large-code-model -o %t/elf_lg_pic_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -check %s %t/elf_lg_pic_reloc.o # # Test ELF large/PIC relocations. diff --git a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_small_pic_relocations.s b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_small_pic_relocations.s index b195693..00c888b 100644 --- a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_small_pic_relocations.s +++ b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_small_pic_relocations.s @@ -1,10 +1,11 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj \ -# RUN: -o %t/elf_sm_pic_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -define-abs external_data=0x1 \ -# RUN: -define-abs extern_out_of_range32=0x7fff00000000 \ -# RUN: -check %s %t/elf_sm_pic_reloc.o +# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \ +# RUN: -filetype=obj -o %t/elf_sm_pic_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_data=0x1 \ +# RUN: -define-abs extern_out_of_range32=0x7fff00000000 \ +# RUN: -check %s %t/elf_sm_pic_reloc.o # # Test ELF small/PIC relocations. diff --git a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86_64_absolute_relocations.s b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86_64_absolute_relocations.s index 56dc1e0..caaaeee 100644 --- a/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86_64_absolute_relocations.s +++ b/llvm/test/ExecutionEngine/JITLink/X86/ELF_x86_64_absolute_relocations.s @@ -1,10 +1,11 @@ # RUN: rm -rf %t && mkdir -p %t -# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj \ -# RUN: -o %t/elf_abs_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ -# RUN: -define-abs external_data_low=0x1 \ -# RUN: -define-abs external_data_high=0xffffffff80000000 \ -# RUN: -check %s %t/elf_abs_reloc.o +# RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \ +# RUN: -filetype=obj -o %t/elf_abs_reloc.o %s +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ +# RUN: -define-abs external_data_low=0x1 \ +# RUN: -define-abs external_data_high=0xffffffff80000000 \ +# RUN: -check %s %t/elf_abs_reloc.o # # Test ELF absolute relocations. diff --git a/llvm/test/ExecutionEngine/JITLink/X86/MachO_GOTAndStubsOptimization.s b/llvm/test/ExecutionEngine/JITLink/X86/MachO_GOTAndStubsOptimization.s index 98df053..caeae4f 100644 --- a/llvm/test/ExecutionEngine/JITLink/X86/MachO_GOTAndStubsOptimization.s +++ b/llvm/test/ExecutionEngine/JITLink/X86/MachO_GOTAndStubsOptimization.s @@ -1,10 +1,10 @@ # RUN: rm -rf %t && mkdir -p %t # RUN: llvm-mc -triple=x86_64-apple-macos10.9 -filetype=obj \ -# RUN: -o %t/helper.o %S/Inputs/MachO_GOTAndStubsOptimizationHelper.s +# RUN: -o %t/helper.o %S/Inputs/MachO_GOTAndStubsOptimizationHelper.s # RUN: llvm-mc -triple=x86_64-apple-macos10.9 -filetype=obj \ -# RUN: -o %t/testcase.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 64Kb -entry=bypass_stub -check %s \ -# RUN: %t/testcase.o %t/helper.o +# RUN: -o %t/testcase.o %s +# RUN: llvm-jitlink -noexec -slab-allocate 64Kb -slab-page-size 4096 \ +# RUN: -entry=bypass_stub -check %s %t/testcase.o %t/helper.o # # Test that references to in-range GOT and stub targets can be bypassed. # The helper file contains a function that uses the GOT for _x, and this file diff --git a/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s b/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s index 3e82336..7efef9c 100644 --- a/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s +++ b/llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s @@ -1,6 +1,7 @@ # RUN: rm -rf %t && mkdir -p %t # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t/macho_reloc.o %s -# RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \ +# RUN: llvm-jitlink -noexec \ +# RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \ # RUN: -define-abs external_data=0x1 -define-abs external_func=0x2 \ # RUN: -check=%s %t/macho_reloc.o # -- 2.7.4