1 ; RUN: opt -mtriple=amdgcn-amd-amdhsa -passes=separate-const-offset-from-gep %s
3 @gv = external local_unnamed_addr addrspace(3) global [16 x i8], align 16
5 ; The add referencing itself is illegal, except it's in an unreachable block.
6 define weak amdgpu_kernel void @foo() {
10 for.body28.i: ; preds = %for.body28.i
11 %arrayidx3389.i = getelementptr inbounds [16 x i8], ptr addrspace(3) @gv, i32 0, i32 %inc38.7.i.1
12 %inc38.7.i.1 = add nuw nsw i32 %inc38.7.i.1, 16
13 br label %for.body28.i