1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 2; RUN: opt -S -mtriple=amdgcn-- -amdgpu-lower-module-lds < %s 2>&1 | FileCheck %s 3; RUN: opt -S -mtriple=amdgcn-- -passes=amdgpu-lower-module-lds < %s 2>&1 | FileCheck %s 4 5; This looks like a partially lowered module, but the non-lowered GV isn't used by any kernels. 6; In such cases, LowerModuleLDS is free to leave it in and ignore it, and we want to make sure 7; LowerModuleLDS doesn't crash if it re-runs on such modules. 8@notLowered = addrspace(3) global i32 poison 9@lowered = addrspace(3) global i32 poison, !absolute_symbol !0 10 11@llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(3) @notLowered to ptr)], section "llvm.metadata" 12 13define amdgpu_kernel void @kern(i32 %val0) { 14; CHECK-LABEL: define amdgpu_kernel void @kern( 15; CHECK-SAME: i32 [[VAL0:%.*]]) { 16; CHECK-NEXT: [[VAL1:%.*]] = add i32 [[VAL0]], 4 17; CHECK-NEXT: store i32 [[VAL1]], ptr addrspace(3) @lowered, align 4 18; CHECK-NEXT: ret void 19; 20 %val1 = add i32 %val0, 4 21 store i32 %val1, ptr addrspace(3) @lowered 22 ret void 23} 24 25 26!0 = !{i32 0, i32 1} 27