1 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn,instcombine -S | FileCheck %s
3 declare ptr @test(ptr nocapture)
8 %Q = call ptr @test(ptr %P)
10 store i32 4, ptr %Q ;; cannot clobber P since it is nocapture.
16 declare void @test3(ptr %p, ptr %q) nounwind
18 define i32 @test4(ptr noalias nocapture %p) nounwind {
19 ; CHECK: call void @test3
20 ; CHECK: store i32 0, ptr %p
21 ; CHECK: store i32 1, ptr %x
22 ; CHECK: %y = load i32, ptr %p
26 ; Here test3 might store %p to %q. This doesn't violate %p's nocapture
27 ; attribute since the copy doesn't outlive the function.
28 call void @test3(ptr %q, ptr %p) nounwind
31 ; This store might write to %p and so we can't eliminate the subsequent