1; RUN: opt -S -mtriple=amdgcn--  -amdgpu-replace-lds-use-with-pointer -amdgpu-enable-lds-replace-with-pointer=true < %s | FileCheck %s
2
3; DESCRIPTION:
4;
5; We do not know what to do with inline asm call, we ignore it, hence pointer replacement for
6; @used_only_within_func does not take place.
7;
8
9; CHECK: @used_only_within_func = addrspace(3) global [4 x i32] undef, align 4
10@used_only_within_func = addrspace(3) global [4 x i32] undef, align 4
11
12; CHECK-NOT: @used_only_within_func.ptr
13
14define void @f0(i32 %x) {
15; CHECK-LABEL: entry:
16; CHECK:   store i32 %x, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* getelementptr inbounds ([4 x i32], [4 x i32] addrspace(3)* @used_only_within_func, i32 0, i32 0) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* getelementptr inbounds ([4 x i32], [4 x i32] addrspace(3)* @used_only_within_func, i32 0, i32 0) to i32*) to i64)) to i32*), align 4
17; CHECK:   ret void
18entry:
19  store i32 %x, i32* inttoptr (i64 add (i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast ([4 x i32] addrspace(3)* @used_only_within_func to i32 addrspace(3)*) to i32*) to i64), i64 ptrtoint (i32* addrspacecast (i32 addrspace(3)* bitcast ([4 x i32] addrspace(3)* @used_only_within_func to i32 addrspace(3)*) to i32*) to i64)) to i32*), align 4
20  ret void
21}
22
23define amdgpu_kernel void @k0() {
24; CHECK-LABEL: entry:
25; CHECK:   call i32 asm "s_mov_b32 $0, 0", "=s"()
26; CHECK:   ret void
27entry:
28  call i32 asm "s_mov_b32 $0, 0", "=s"()
29  ret void
30}
31