aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Analysis/BasicAA/call.ll
blob: c394511877fe2998ff6d4e903c88ddf3ee0c5d88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; RUN: opt -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 < %s | FileCheck %s

declare void @callee(ptr)

; CHECK-LABEL: Function: test
; CHECK: NoModRef: Ptr: i32* %a.gep <-> call void @callee(ptr %gep)
define void @test(i1 %c, ptr %arg) {
  %a = alloca [2 x i32]
  %a.gep = getelementptr i8, ptr %a, i64 4
  %sel = select i1 %c, ptr %arg, ptr null
  %gep = getelementptr i8, ptr %sel, i64 4
  call void @callee(ptr %gep)
  %l = load i32, ptr %a.gep
  ret void
}