1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/GVNSink/operand-mismatch.ll
Sanjay Patel a81820b258 [GVNSink] prevent crashing on mismatched instructions (PR42346)
Patch based on suggestion by James Molloy (@jmolloy) in:
https://bugs.llvm.org/show_bug.cgi?id=42346

llvm-svn: 364062
2019-06-21 15:17:24 +00:00

35 lines
883 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -gvn-sink -S < %s | FileCheck %s
; This would assert/crash because the calls have different numbers of operands:
; https://bugs.llvm.org/show_bug.cgi?id=42346
%vec = type opaque
%map = type { i32 }
define void @PR42346() {
; CHECK-LABEL: @PR42346(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL1:%.*]] = call %vec* @bar(%map* undef, %vec* (%map*)* undef)
; CHECK-NEXT: br label [[EXIT:%.*]]
; CHECK: if:
; CHECK-NEXT: [[CALL2:%.*]] = call %vec* @baz(%map* undef)
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
; CHECK-NEXT: ret void
;
entry:
%call1 = call %vec* @bar(%map* undef, %vec* (%map*)* undef)
br label %exit
if:
%call2 = call %vec* @baz(%map* undef)
br label %exit
exit:
ret void
}
declare %vec* @bar(%map*, %vec* (%map*)*)
declare %vec* @baz(%map*)