1 ; RUN: opt < %s -O3 -S | FileCheck %s
3 ; Address space intrinsics were erroneously marked NoCapture, leading to bad
4 ; optimizations (such as the store below being eliminated as dead code). This
5 ; test makes sure we don't regress.
7 declare void @foo(ptr addrspace(1))
9 declare ptr addrspace(1) @llvm.nvvm.ptr.gen.to.global.p1.p0(ptr)
14 ; CHECK: call ptr addrspace(1) @llvm.nvvm.ptr.gen.to.global.p1.p0(ptr nonnull %t1)
15 ; CHECK-NEXT: store i32 10, ptr %t1
16 %t2 = call ptr addrspace(1) @llvm.nvvm.ptr.gen.to.global.p1.p0(ptr %t1)
18 call void @foo(ptr addrspace(1) %t2)