1 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s
2 target datalayout = "p:64:64"
4 declare void @escape(ptr %ptr)
6 ; Verify that unescaped noalias parameter does not alias inttoptr
7 define void @test1(ptr noalias %P, i64 %Q_as_int) {
8 ; CHECK-LABEL: Function: test1:
9 ; CHECK: NoAlias: i8* %P, i8* %Q
10 %Q = inttoptr i64 %Q_as_int to ptr
16 ; Verify that unescaped alloca does not alias inttoptr
17 define void @test2(i64 %Q_as_int) {
18 ; CHECK-LABEL: Function: test2:
19 ; CHECK: NoAlias: i8* %P, i8* %Q
21 %Q = inttoptr i64 %Q_as_int to ptr
27 ; Verify that escaped noalias parameter may alias inttoptr
28 define void @test3(ptr noalias %P, i64 %Q_as_int) {
29 ; CHECK-LABEL: Function: test3:
30 ; CHECK: MayAlias: i8* %P, i8* %Q
31 call void @escape(ptr %P)
32 %Q = inttoptr i64 %Q_as_int to ptr
38 ; Verify that escaped alloca may alias inttoptr
39 define void @test4(i64 %Q_as_int) {
40 ; CHECK-LABEL: Function: test4:
41 ; CHECK: MayAlias: i8* %P, i8* %Q
43 call void @escape(ptr %P)
44 %Q = inttoptr i64 %Q_as_int to ptr
51 ; Verify that global may alias inttoptr
52 @G = external global i8
53 define void @test5(i64 %Q_as_int) {
54 ; CHECK-LABEL: Function: test5:
55 ; CHECK: MayAlias: i8* %Q, i8* @G
56 %Q = inttoptr i64 %Q_as_int to ptr