1 ; RUN: llvm-split -o %t %s -j 3 -mtriple amdgcn-amd-amdhsa
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: @foo = hidden constant ptr poison
10 ; CHECK0: @bar = hidden constant ptr poison
11 ; CHECK0: define amdgpu_kernel void @C
13 ; CHECK1: @foo = external hidden constant ptr{{$}}
14 ; CHECK1: @bar = external hidden constant ptr{{$}}
15 ; CHECK1: define amdgpu_kernel void @A
17 ; CHECK2: @foo = external hidden constant ptr{{$}}
18 ; CHECK2: @bar = external hidden constant ptr{{$}}
19 ; CHECK2: define amdgpu_kernel void @B
21 @foo = private constant ptr poison
22 @bar = internal constant ptr poison
24 define amdgpu_kernel void @A() {
25 store i32 42, ptr @foo
29 define amdgpu_kernel void @B() {
30 store i32 42, ptr @foo
31 store i32 42, ptr @bar
35 define amdgpu_kernel void @C() {
36 store i32 42, ptr @bar