diff options
Diffstat (limited to 'test/CodeGen/AArch64/jump-table.ll')
-rw-r--r-- | test/CodeGen/AArch64/jump-table.ll | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/test/CodeGen/AArch64/jump-table.ll b/test/CodeGen/AArch64/jump-table.ll index dcf9f4ed45..3c7f5f9ec1 100644 --- a/test/CodeGen/AArch64/jump-table.ll +++ b/test/CodeGen/AArch64/jump-table.ll @@ -1,5 +1,6 @@ ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s -; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -filetype=obj | elf-dump | FileCheck %s -check-prefix=CHECK-ELF +; RUN: llc -code-model=large -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck --check-prefix=CHECK-LARGE %s +; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -filetype=obj | llvm-readobj -r | FileCheck %s -check-prefix=CHECK-ELF define i32 @test_jumptable(i32 %in) { ; CHECK: test_jumptable @@ -15,6 +16,13 @@ define i32 @test_jumptable(i32 %in) { ; CHECK: ldr [[DEST:x[0-9]+]], [x[[JT]], {{x[0-9]+}}, lsl #3] ; CHECK: br [[DEST]] +; CHECK-LARGE: movz x[[JTADDR:[0-9]+]], #:abs_g3:.LJTI0_0 +; CHECK-LARGE: movk x[[JTADDR]], #:abs_g2_nc:.LJTI0_0 +; CHECK-LARGE: movk x[[JTADDR]], #:abs_g1_nc:.LJTI0_0 +; CHECK-LARGE: movk x[[JTADDR]], #:abs_g0_nc:.LJTI0_0 +; CHECK-LARGE: ldr [[DEST:x[0-9]+]], [x[[JTADDR]], {{x[0-9]+}}, lsl #3] +; CHECK-LARGE: br [[DEST]] + def: ret i32 0 @@ -44,13 +52,15 @@ lbl4: ; ELF tests: ; First make sure we get a page/lo12 pair in .text to pick up the jump-table -; CHECK-ELF: .rela.text -; CHECK-ELF: ('r_sym', 0x00000008) -; CHECK-ELF-NEXT: ('r_type', 0x00000113) -; CHECK-ELF: ('r_sym', 0x00000008) -; CHECK-ELF-NEXT: ('r_type', 0x00000115) + +; CHECK-ELF: Relocations [ +; CHECK-ELF: Section ({{[0-9]+}}) .text { +; CHECK-ELF-NEXT: 0x{{[0-9,A-F]+}} R_AARCH64_ADR_PREL_PG_HI21 .rodata +; CHECK-ELF-NEXT: 0x{{[0-9,A-F]+}} R_AARCH64_ADD_ABS_LO12_NC .rodata +; CHECK-ELF: } ; Also check the targets in .rodata are relocated -; CHECK-ELF: .rela.rodata -; CHECK-ELF: ('r_sym', 0x00000005) -; CHECK-ELF-NEXT: ('r_type', 0x00000101)
\ No newline at end of file +; CHECK-ELF: Section ({{[0-9]+}}) .rodata { +; CHECK-ELF-NEXT: 0x{{[0-9,A-F]+}} R_AARCH64_ABS64 .text +; CHECK-ELF: } +; CHECK-ELF: ] |