1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/tools/llvm-diff/callbr.ll
Bill Wendling 31cd676e0f [llvm-diff] Add support for diffing the callbr instruction
The only wrinkle is that we can't process the "blockaddress" arguments
of the callbr until the blocks have been equated. So we force them to be
"unified" before checking.

This was left out when the callbr instruction was added.

Differential Revision: https://reviews.llvm.org/D104606
2021-06-22 12:23:37 -07:00

40 lines
1.2 KiB
LLVM

; RUN: not llvm-diff %s %s 2>&1 | FileCheck %s
define void @foo() {
entry:
callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@foo, %return), i8* blockaddress(@foo, %t_no))
to label %asm.fallthrough [label %return, label %t_no]
asm.fallthrough:
br label %return
t_no:
br label %return
return:
ret void
}
; CHECK: in function bar:
; CHECK-NOT: in function foo:
; CHECK-NEXT: in block %entry:
; CHECK-NEXT: > callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@foo, %t_no), i8* blockaddress(@foo, %return))
; CHECK-NEXT: to label %asm.fallthrough [label %return, label %t_no]
; CHECK-NEXT: < callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@foo, %t_no), i8* blockaddress(@foo, %return))
; CHECK-NEXT: to label %asm.fallthrough [label %return, label %t_no]
define void @bar() {
entry:
callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@foo, %t_no), i8* blockaddress(@foo, %return))
to label %asm.fallthrough [label %return, label %t_no]
asm.fallthrough:
br label %return
t_no:
br label %return
return:
ret void
}