2020-03-03 16:52:20 +08:00
|
|
|
; RUN: llc -mattr=sram,eijmpcall < %s -march=avr -verify-machineinstrs | FileCheck %s
|
2016-11-17 05:58:04 +08:00
|
|
|
|
2021-07-02 18:25:43 +08:00
|
|
|
@brind.k = private unnamed_addr constant [2 x i8 addrspace(1)*] [i8 addrspace(1)* blockaddress(@brind, %return), i8 addrspace(1)* blockaddress(@brind, %b)], align 1
|
2016-11-17 05:58:04 +08:00
|
|
|
|
|
|
|
define i8 @brind(i8 %p) {
|
|
|
|
; CHECK-LABEL: brind:
|
|
|
|
; CHECK: ijmp
|
|
|
|
entry:
|
|
|
|
%idxprom = sext i8 %p to i16
|
2021-07-02 18:25:43 +08:00
|
|
|
%arrayidx = getelementptr inbounds [2 x i8 addrspace(1)*], [2 x i8 addrspace(1)*]* @brind.k, i16 0, i16 %idxprom
|
|
|
|
%s = load i8 addrspace(1)*, i8 addrspace(1)** %arrayidx
|
|
|
|
indirectbr i8 addrspace(1)* %s, [label %return, label %b]
|
2016-11-17 05:58:04 +08:00
|
|
|
b:
|
|
|
|
br label %return
|
|
|
|
return:
|
|
|
|
%retval.0 = phi i8 [ 4, %b ], [ 2, %entry ]
|
|
|
|
ret i8 %retval.0
|
|
|
|
}
|