1 ; RUN: llvm-split -o %t %s -j 3 -mtriple amdgcn-amd-amdhsa -amdgpu-module-splitting-no-externalize-globals
2 ; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 --implicit-check-not=define %s
3 ; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 --implicit-check-not=define %s
4 ; RUN: llvm-dis -o - %t2 | FileCheck --check-prefix=CHECK2 --implicit-check-not=define %s
6 ; 3 kernels use private/internal global variables.
7 ; The GVs should be copied in each partition as needed.
9 ; CHECK0: @bar = internal constant ptr
10 ; CHECK0: define amdgpu_kernel void @C
12 ; CHECK1: @foo = private constant ptr
13 ; CHECK1: define amdgpu_kernel void @A
15 ; CHECK2: @foo = private constant ptr
16 ; CHECK2: @bar = internal constant ptr
17 ; CHECK2: define amdgpu_kernel void @B
19 @foo = private constant ptr poison
20 @bar = internal constant ptr poison
22 define amdgpu_kernel void @A() {
23 store i32 42, ptr @foo
27 define amdgpu_kernel void @B() {
28 store i32 42, ptr @foo
29 store i32 42, ptr @bar
33 define amdgpu_kernel void @C() {
34 store i32 42, ptr @bar