llvm-6502/test/CodeGen/XCore/events.ll
Richard Osborne d04b4937d1 Add XCore intrinsic for clre instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126322 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23 18:52:05 +00:00

25 lines
672 B
LLVM

; RUN: llc < %s -march=xcore | FileCheck %s
declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
declare i8* @llvm.xcore.waitevent()
declare void @llvm.xcore.clre()
define i32 @f(i8 addrspace(1)* %r) nounwind {
; CHECK: f:
entry:
; CHECK: clre
call void @llvm.xcore.clre()
call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L1))
call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L2))
%goto_addr = call i8* @llvm.xcore.waitevent()
; CHECK: waiteu
indirectbr i8* %goto_addr, [label %L1, label %L2]
L1:
br label %ret
L2:
br label %ret
ret:
%retval = phi i32 [1, %L1], [2, %L2]
ret i32 %retval
}