llvm/llvm/test/Transforms/SCCP/landingpad.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=ipsccp < %s | FileCheck %s

; SCCP should never remove landingpads.

declare void @fn()

define void @test() personality ptr null {
; CHECK-LABEL: @test(
; CHECK-NEXT:    invoke void @fn()
; CHECK-NEXT:    to label [[SUCCESS:%.*]] unwind label [[FAILURE:%.*]]
; CHECK:       success:
; CHECK-NEXT:    ret void
; CHECK:       failure:
; CHECK-NEXT:    [[PAD:%.*]] = landingpad {}
; CHECK-NEXT:    cleanup
; CHECK-NEXT:    unreachable
;
  invoke void @fn()
  to label %success unwind label %failure

success:
  ret void

failure:
  %pad = landingpad {}
  cleanup
  unreachable
}