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(i32 addrspace(1)*)
9 declare i32 addrspace(1)* @llvm.nvvm.ptr.gen.to.global.p1i32.p0i32(i32*)
14 ; CHECK: call i32 addrspace(1)* @llvm.nvvm.ptr.gen.to.global.p1i32.p0i32(i32* %t1)
15 ; CHECK-NEXT: store i32 10, i32* %t1
16 %t2 = call i32 addrspace(1)* @llvm.nvvm.ptr.gen.to.global.p1i32.p0i32(i32* %t1)
17 store i32 10, i32* %t1
18 call void @foo(i32 addrspace(1)* %t2)