| 1 |
; RUN: llc < %s -mtriple=thumbv7em-arm-none-eabi -relocation-model=static | FileCheck %s -check-prefixes=CHECK,STATIC |
| 2 |
; RUN: llc < %s -mtriple=thumbv7em-arm-none-eabi -relocation-model=rwpi | FileCheck %s -check-prefixes=CHECK,RWPI |
| 3 |
|
| 4 |
define void @fn() #0 { |
| 5 |
entry: |
| 6 |
; CHECK-LABEL: fn: |
| 7 |
; CHECK: ldr [[REG:r[0-9]+]], .LCPI0_0 |
| 8 |
; CHECK-NEXT: blx [[REG]] |
| 9 |
; CHECK: .LCPI0_0: |
| 10 |
; CHECK-NEXT: .long bar |
| 11 |
call void @bar() |
| 12 |
ret void |
| 13 |
} |
| 14 |
|
| 15 |
define void @execute_only_fn() #1 { |
| 16 |
; STATIC-LABEL: execute_only_fn: |
| 17 |
; STATIC: movw [[REG0:r[0-9]+]], :lower16:bar |
| 18 |
; STATIC-NEXT: movt [[REG0]], :upper16:bar |
| 19 |
; STATIC-NEXT: blx [[REG0]] |
| 20 |
; STATIC-NOT: .LCPI0_0: |
| 21 |
|
| 22 |
; RWPI-LABEL: execute_only_fn: |
| 23 |
; RWPI: movw [[REG0:r[0-9]+]], :lower16:bar |
| 24 |
; RWPI-NEXT: movt [[REG0]], :upper16:bar |
| 25 |
; RWPI-NEXT: blx [[REG0]] |
| 26 |
; RWPI-NOT: .LCPI1_0: |
| 27 |
entry: |
| 28 |
call void @bar() |
| 29 |
ret void |
| 30 |
} |
| 31 |
|
| 32 |
attributes #0 = { noinline optnone "target-features"="+thumb-mode,+long-calls" } |
| 33 |
attributes #1 = { noinline optnone "target-features"="+execute-only,+thumb-mode,+long-calls" } |
| 34 |
|
| 35 |
declare dso_local void @bar() |