aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM/jump_tables.ll
blob: 907a86c25387b80bf8f74e0f68be865b38e2fb8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; RUN: llc <%s -mtriple=arm-unknown-linux-gnueabi -jump-table-type=single | FileCheck --check-prefix=ARM %s
; RUN: llc <%s -mtriple=thumb-unknown-linux-gnueabi -jump-table-type=single | FileCheck --check-prefix=THUMB %s

define void @indirect_fun() unnamed_addr jumptable {
  ret void
}
define void ()* @get_fun() {
  ret void ()* @indirect_fun

; ARM:         ldr     r0, [[LABEL:.*]]
; ARM:         mov     pc, lr
; ARM: [[LABEL]]:
; ARM:         .long   __llvm_jump_instr_table_0_1

; THUMB:         ldr     r0, [[LABEL:.*]]
; THUMB:         bx      lr
; THUMB: [[LABEL]]:
; THUMB:         .long   __llvm_jump_instr_table_0_1
}

; ARM:         .globl  __llvm_jump_instr_table_0_1
; ARM:         .align  3
; ARM:         .type   __llvm_jump_instr_table_0_1,%function
; ARM: __llvm_jump_instr_table_0_1:
; ARM:         b     indirect_fun(PLT)

; THUMB:         .globl  __llvm_jump_instr_table_0_1
; THUMB:         .align  3
; THUMB:         .thumb_func
; THUMB:         .type   __llvm_jump_instr_table_0_1,%function
; THUMB: __llvm_jump_instr_table_0_1:
; THUMB:         b     indirect_fun(PLT)