39 lines · plain
1; This test checks that Module splitting can properly perform device code split by tracking2; all uses of functions (not only direct calls).3 4; RUN: llvm-split -split-by-category=module-id -S < %s -o %t5; RUN: FileCheck %s -input-file=%t_0.ll --check-prefix=CHECK-IR06; RUN: FileCheck %s -input-file=%t_1.ll --check-prefix=CHECK-IR17 8; CHECK-IR0: define dso_local spir_kernel void @kernelA9;10; CHECK-IR1: @FuncTable = weak global ptr @func11; CHECK-IR1: define {{.*}} i32 @func12; CHECK-IR1: define weak_odr dso_local spir_kernel void @kernelB13 14@FuncTable = weak global ptr @func, align 815 16define dso_local spir_func i32 @func(i32 %a) {17entry:18 ret i32 %a19}20 21define weak_odr dso_local spir_kernel void @kernelB() #0 {22entry:23 %0 = call i32 @indirect_call(ptr addrspace(4) addrspacecast ( ptr getelementptr inbounds ( [1 x ptr] , ptr @FuncTable, i64 0, i64 0) to ptr addrspace(4)), i32 0)24 ret void25}26 27define dso_local spir_kernel void @kernelA() #1 {28entry:29 ret void30}31 32declare dso_local spir_func i32 @indirect_call(ptr addrspace(4), i32) local_unnamed_addr33 34attributes #0 = { "module-id"="TU1.cpp" }35attributes #1 = { "module-id"="TU2.cpp" }36 37; CHECK: kernel138; CHECK: kernel239