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; Temporarily disable modref checks
16; NoModRef: Ptr: i32* %b <-> %c = call i32* @return_arg_callee(i32* %a, i32* %b)
17define void @test_return_arg() {
18  %a = alloca i32, align 4
19  %b = alloca i32, align 4
20
21  %c = call i32* @return_arg_callee(i32* %a, i32* %b)
22
23  ret void
24}