1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Assembler/br-single-destination.ll
Duncan P. N. Exon Smith 6f510dfce8 IR: Fix use-list-order round-tripping for br
Fix the use-list-order for br instructions by setting the operands in
order of their index to match the use-list-order prediction. The case
where this matters is when there is a condition but the if-true and
if-false branches are identical.

Bug was found when reviewing failures pointed at by
https://reviews.llvm.org/D104950. Fix is similar to
3cf415c6c367ced43175ebd1dc4bd9582c7f5376.

Differential Revision: https://reviews.llvm.org/D104959
2021-06-28 12:53:36 -07:00

12 lines
243 B
LLVM

; RUN: llvm-as < %s -disable-output 2>&1 | FileCheck %s -allow-empty
; CHECK-NOT: error
; CHECK-NOT: warning
; RUN: verify-uselistorder < %s
define void @f1(i1 %cmp) {
entry:
br i1 %cmp, label %branch, label %branch
branch:
unreachable
}