1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes='early-cse<memssa>,loop-mssa(licm)' < %s | FileCheck %s
4 ; This used to assert because was have a MemoryDef for what turns out to be
5 ; a readnone call after EarlyCSE.
7 @fn_ptr = external global ptr, align 1
12 ; CHECK-NEXT: br label [[DO_BODY:%.*]]
14 ; CHECK-NEXT: store ptr @readnone_fn, ptr @fn_ptr, align 8
15 ; CHECK-NEXT: call void @readnone_fn()
16 ; CHECK-NEXT: call void @foo()
17 ; CHECK-NEXT: br label [[DO_BODY]]
23 store ptr @readnone_fn, ptr @fn_ptr
24 %fn = load ptr, ptr @fn_ptr
31 declare void @readnone_fn() readnone