2011-02-24 02:35:59 +08:00
|
|
|
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
|
|
|
|
|
|
declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p)
|
|
|
|
declare i8* @llvm.xcore.waitevent()
|
2011-03-17 02:34:00 +08:00
|
|
|
declare i8* @llvm.xcore.checkevent(i8*)
|
2011-02-24 02:52:05 +08:00
|
|
|
declare void @llvm.xcore.clre()
|
2011-02-24 02:35:59 +08:00
|
|
|
|
|
|
|
define i32 @f(i8 addrspace(1)* %r) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f:
|
2011-02-24 02:35:59 +08:00
|
|
|
entry:
|
2011-02-24 02:52:05 +08:00
|
|
|
; CHECK: clre
|
|
|
|
call void @llvm.xcore.clre()
|
2011-02-24 02:35:59 +08:00
|
|
|
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
|
|
|
|
}
|
2011-03-17 02:34:00 +08:00
|
|
|
|
|
|
|
define i32 @g(i8 addrspace(1)* %r) nounwind {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: g:
|
2011-03-17 02:34:00 +08:00
|
|
|
entry:
|
|
|
|
; CHECK: clre
|
|
|
|
call void @llvm.xcore.clre()
|
|
|
|
call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L1))
|
|
|
|
%goto_addr = call i8* @llvm.xcore.checkevent(i8 *blockaddress(@f, %L2))
|
|
|
|
; CHECK: setsr 1
|
|
|
|
; CHECK: clrsr 1
|
|
|
|
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
|
|
|
|
}
|