1; This testcase ensures that CFL AA answers queries soundly when callee tries
2; to return one of its parameters
3
4; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
5; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
6
7define i32* @return_arg_callee(i32* %arg1, i32* %arg2) {
8  ret i32* %arg1
9}
10; CHECK-LABEL: Function: test_return_arg
11; CHECK: NoAlias: i32* %a, i32* %b
12; CHECK: MayAlias: i32* %a, i32* %c
13; CHECK: NoAlias: i32* %b, i32* %c
14
15; CHECK: NoModRef: Ptr: i32* %b <-> %c = call i32* @return_arg_callee(i32* %a, i32* %b)
16define void @test_return_arg() {
17  %a = alloca i32, align 4
18  %b = alloca i32, align 4
19
20  %c = call i32* @return_arg_callee(i32* %a, i32* %b)
21
22  ret void
23}