1 ; This testcase ensures that CFL AA answers queries soundly when callee tries
2 ; to mutate the memory pointed to by its parameters
4 ; RUN: opt < %s -disable-basicaa -cfl-anders-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
5 ; RUN: opt < %s -aa-pipeline=cfl-anders-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
7 define void @store_arg_callee(i32** %arg1, i32* %arg2) {
8 store i32* %arg2, i32** %arg1
11 ; CHECK-LABEL: Function: test_store_arg
12 ; CHECK: NoAlias: i32* %a, i32* %b
13 ; CHECK: NoAlias: i32* %a, i32** %p
14 ; CHECK: NoAlias: i32* %b, i32** %p
15 ; CHECK: MayAlias: i32* %a, i32* %lp
16 ; CHECK: MayAlias: i32* %b, i32* %lp
17 ; CHECK: NoAlias: i32* %a, i32* %lq
18 ; CHECK: MayAlias: i32* %b, i32* %lq
19 ; CHECK: MayAlias: i32* %lp, i32* %lq
21 ; Temporarily disable modref checks
22 ; NoModRef: Ptr: i32* %a <-> call void @store_arg_callee(i32** %p, i32* %b)
23 ; Just Ref: Ptr: i32* %b <-> call void @store_arg_callee(i32** %p, i32* %b)
24 ; Just Mod: Ptr: i32** %p <-> call void @store_arg_callee(i32** %p, i32* %b)
25 ; NoModRef: Ptr: i32** %q <-> call void @store_arg_callee(i32** %p, i32* %b)
26 define void @test_store_arg() {
27 %a = alloca i32, align 4
28 %b = alloca i32, align 4
29 %p = alloca i32*, align 8
30 %q = alloca i32*, align 8
32 store i32* %a, i32** %p
33 store i32* %b, i32** %q
34 call void @store_arg_callee(i32** %p, i32* %b)
36 %lp = load i32*, i32** %p
37 %lq = load i32*, i32** %q