File: jump_tables.ll

package info (click to toggle)
llvm-toolchain-3.5 1%3A3.5.2-3~bpo8%2B2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 283,276 kB
  • sloc: cpp: 1,884,580; ansic: 310,787; objc: 86,612; python: 79,608; asm: 65,866; sh: 9,829; makefile: 6,068; perl: 5,589; ml: 5,254; pascal: 3,285; lisp: 1,640; xml: 686; cs: 239; csh: 117
file content (32 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (2)
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)