1 ; RUN: llc -mtriple=aarch64-none-linux-gnu -aarch64-enable-atomic-cfg-tidy=0 -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -code-model=large -mtriple=aarch64-none-linux-gnu -aarch64-enable-atomic-cfg-tidy=0 -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-LARGE %s
3 ; RUN: llc -code-model=large -relocation-model=pic -mtriple=aarch64-none-linux-gnu -aarch64-enable-atomic-cfg-tidy=0 < %s | FileCheck %s
4 ; RUN: llc -code-model=tiny -mtriple=aarch64-none-elf -aarch64-enable-atomic-cfg-tidy=0 -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-TINY %s
6 @addr = global ptr null
8 define void @test_blockaddress() {
9 ; CHECK-LABEL: test_blockaddress:
10 store volatile ptr blockaddress(@test_blockaddress, %block), ptr @addr
11 %val = load volatile ptr, ptr @addr
12 indirectbr ptr %val, [label %block]
13 ; CHECK: adrp [[DEST_HI:x[0-9]+]], [[DEST_LBL:.Ltmp[0-9]+]]
14 ; CHECK: add [[DEST:x[0-9]+]], [[DEST_HI]], {{#?}}:lo12:[[DEST_LBL]]
15 ; CHECK: str [[DEST]],
16 ; CHECK: ldr [[NEWDEST:x[0-9]+]]
17 ; CHECK: br [[NEWDEST]]
19 ; CHECK-LARGE: movz [[ADDR_REG:x[0-9]+]], #:abs_g0_nc:[[DEST_LBL:.Ltmp[0-9]+]]
20 ; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g1_nc:[[DEST_LBL]]
21 ; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g2_nc:[[DEST_LBL]]
22 ; CHECK-LARGE: movk [[ADDR_REG]], #:abs_g3:[[DEST_LBL]]
23 ; CHECK-LARGE: str [[ADDR_REG]],
24 ; CHECK-LARGE: ldr [[NEWDEST:x[0-9]+]]
25 ; CHECK-LARGE: br [[NEWDEST]]
27 ; CHECK-TINY: adr [[DEST:x[0-9]+]], {{.Ltmp[0-9]+}}
28 ; CHECK-TINY: str [[DEST]],
29 ; CHECK-TINY: ldr [[NEWDEST:x[0-9]+]]
30 ; CHECK-TINY: br [[NEWDEST]]