xref: /llvm-project/llvm/test/Analysis/MemorySSA/call-bitcast.ll (revision 8e44f13c6d294e6b4864441b22045b507782540c)
1; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
2;
3; Ensures that MemorySSA leverages the ground truth of the function being
4; called even if the call and function signatures don't match.
5
6declare i1 @opaque_true(i1) nounwind readonly
7
8define i1 @foo(ptr %ptr, i1 %cond) {
9  %cond_wide = zext i1 %cond to i32
10; CHECK: MemoryUse(liveOnEntry)
11; CHECK-NEXT: call i32 @opaque_true(i32 %cond_wide)
12  %cond_hidden_wide = call i32 @opaque_true(i32 %cond_wide)
13  %cond_hidden = trunc i32 %cond_hidden_wide to i1
14  ret i1 %cond_hidden
15}
16