1 ; RUN: llc -O0 -fast-isel -fast-isel-abort=1 -verify-machineinstrs -mtriple=arm64-apple-darwin < %s | FileCheck %s
3 @fn.table = internal global [2 x i8*] [i8* blockaddress(@fn, %ZERO), i8* blockaddress(@fn, %ONE)], align 8
5 define i32 @fn(i32 %target) nounwind {
8 %retval = alloca i32, align 4
9 %target.addr = alloca i32, align 4
10 store i32 %target, i32* %target.addr, align 4
11 %0 = load i32, i32* %target.addr, align 4
12 %idxprom = zext i32 %0 to i64
13 %arrayidx = getelementptr inbounds [2 x i8*], [2 x i8*]* @fn.table, i32 0, i64 %idxprom
14 %1 = load i8*, i8** %arrayidx, align 8
15 br label %indirectgoto
17 ZERO: ; preds = %indirectgoto
19 store i32 0, i32* %retval
22 ONE: ; preds = %indirectgoto
24 store i32 1, i32* %retval
27 return: ; preds = %ONE, %ZERO
28 %2 = load i32, i32* %retval
31 indirectgoto: ; preds = %entry
32 ; CHECK: ldr [[REG:x[0-9]+]], [sp]
33 ; CHECK-NEXT: br [[REG]]
34 %indirect.goto.dest = phi i8* [ %1, %entry ]
35 indirectbr i8* %indirect.goto.dest, [label %ZERO, label %ONE]