blob: 0ee4336c7fa5b42fc2139c0a18ce20c81b7addd4 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/
; RUN: opt -S -passes='early-cse<memssa>,loop-mssa(licm)' < %s | FileCheck %s
; This used to assert because was have a MemoryDef for what turns out to be
; a readnone call after EarlyCSE.
@fn_ptr = external global ptr, align 1
define void @test() {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[DO_BODY:%.*]]
; CHECK: do.body:
; CHECK-NEXT: store ptr @readnone_fn, ptr @fn_ptr, align 8
; CHECK-NEXT: call void @readnone_fn()
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[DO_BODY]]
br label %do.body
store ptr @readnone_fn, ptr @fn_ptr
%fn = load ptr, ptr @fn_ptr
call void %fn()
call void @foo()
br label %do.body
declare void @foo()
declare void @readnone_fn() readnone