2014-05-30 18:09:59 +08:00
|
|
|
; RUN: llc -mtriple=aarch64-none-linux-gnu -aarch64-atomic-cfg-tidy=0 -verify-machineinstrs < %s | FileCheck %s
|
|
|
|
; RUN: llc -code-model=large -mtriple=aarch64-none-linux-gnu -aarch64-atomic-cfg-tidy=0 -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-LARGE %s
|
2013-01-31 20:12:40 +08:00
|
|
|
|
|
|
|
@addr = global i8* null
|
|
|
|
|
|
|
|
define void @test_blockaddress() {
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test_blockaddress:
|
2013-01-31 20:12:40 +08:00
|
|
|
store volatile i8* blockaddress(@test_blockaddress, %block), i8** @addr
|
2015-02-28 05:17:42 +08:00
|
|
|
%val = load volatile i8*, i8** @addr
|
2013-01-31 20:12:40 +08:00
|
|
|
indirectbr i8* %val, [label %block]
|
|
|
|
; CHECK: adrp [[DEST_HI:x[0-9]+]], [[DEST_LBL:.Ltmp[0-9]+]]
|
2014-04-14 20:50:58 +08:00
|
|
|
; CHECK: add [[DEST:x[0-9]+]], [[DEST_HI]], {{#?}}:lo12:[[DEST_LBL]]
|
2013-01-31 20:12:40 +08:00
|
|
|
; CHECK: str [[DEST]],
|
|
|
|
; CHECK: ldr [[NEWDEST:x[0-9]+]]
|
|
|
|
; CHECK: br [[NEWDEST]]
|
|
|
|
|
2013-05-05 00:53:53 +08:00
|
|
|
; CHECK-LARGE: movz [[ADDR_REG:x[0-9]+]], #:abs_g3:[[DEST_LBL:.Ltmp[0-9]+]]
|
|
|
|
; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g2_nc:[[DEST_LBL]]
|
|
|
|
; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g1_nc:[[DEST_LBL]]
|
|
|
|
; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g0_nc:[[DEST_LBL]]
|
|
|
|
; CHECK-LARGE: str [[ADDR_REG]],
|
|
|
|
; CHECK-LARGE: ldr [[NEWDEST:x[0-9]+]]
|
|
|
|
; CHECK-LARGE: br [[NEWDEST]]
|
|
|
|
|
2013-01-31 20:12:40 +08:00
|
|
|
block:
|
|
|
|
ret void
|
|
|
|
}
|