|
| 1 | +; This test checks that the post-link tool generates list of kernel names. |
| 2 | +; |
| 3 | +; Global scope |
| 4 | +; RUN: sycl-post-link -properties -symbols -emit-kernel-names -S < %s -o %t.global.files.table |
| 5 | +; RUN: FileCheck %s -input-file=%t.global.files_0.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-GLOBAL-PROP |
| 6 | +; |
| 7 | +; Per-module split |
| 8 | +; RUN: sycl-post-link -properties -symbols -split=source -emit-kernel-names -S < %s -o %t.per_module.files.table |
| 9 | +; RUN: FileCheck %s -input-file=%t.per_module.files_0.prop -implicit-check-not="SpirFunc" --check-prefix=CHECK-PERMODULE-0-PROP |
| 10 | +; RUN: FileCheck %s -input-file=%t.per_module.files_1.prop -implicit-check-not="SpirFunc" --check-prefix=CHECK-PERMODULE-1-PROP |
| 11 | +; RUN: FileCheck %s -input-file=%t.per_module.files_2.prop -implicit-check-not="SpirFunc" --check-prefix=CHECK-KERNELLESS-PROP |
| 12 | +; |
| 13 | +; Per-kernel split |
| 14 | +; RUN: sycl-post-link -properties -symbols -split=kernel -emit-kernel-names -S < %s -o %t.per_kernel.files.table |
| 15 | +; RUN: FileCheck %s -input-file=%t.per_kernel.files_0.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-PERKERNEL-0-PROP |
| 16 | +; RUN: FileCheck %s -input-file=%t.per_kernel.files_1.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-PERKERNEL-1-PROP |
| 17 | +; RUN: FileCheck %s -input-file=%t.per_kernel.files_2.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-PERKERNEL-2-PROP |
| 18 | +; RUN: FileCheck %s -input-file=%t.per_kernel.files_3.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-KERNELLESS-PROP |
| 19 | +; RUN: FileCheck %s -input-file=%t.per_kernel.files_4.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-KERNELLESS-PROP |
| 20 | +; RUN: FileCheck %s -input-file=%t.per_kernel.files_5.prop --implicit-check-not="SpirFunc" --check-prefix=CHECK-KERNELLESS-PROP |
| 21 | + |
| 22 | +target triple = "spir64-unknown-unknown" |
| 23 | + |
| 24 | +define dso_local spir_kernel void @SpirKernel1(float %arg1) #2 { |
| 25 | +entry: |
| 26 | + ret void |
| 27 | +} |
| 28 | + |
| 29 | +define dso_local spir_kernel void @SpirKernel2(float %arg1) #1 { |
| 30 | +entry: |
| 31 | + ret void |
| 32 | +} |
| 33 | + |
| 34 | +define dso_local spir_kernel void @SpirKernel3(float %arg1) #2 { |
| 35 | +entry: |
| 36 | + ret void |
| 37 | +} |
| 38 | + |
| 39 | +define dso_local spir_func void @SpirFunc1(float %arg1) #0 { |
| 40 | +entry: |
| 41 | + ret void |
| 42 | +} |
| 43 | + |
| 44 | +define dso_local spir_func void @SpirFunc2(i32 %arg1, i32 %arg2) #1 { |
| 45 | +entry: |
| 46 | + ret void |
| 47 | +} |
| 48 | + |
| 49 | +define dso_local spir_func void @SpirFunc3(float %arg1) #0 { |
| 50 | +entry: |
| 51 | + ret void |
| 52 | +} |
| 53 | + |
| 54 | +define dso_local spir_func void @SpirFunc4(float %arg1) { |
| 55 | +entry: |
| 56 | + ret void |
| 57 | +} |
| 58 | + |
| 59 | +attributes #0 = { "sycl-module-id"="a.cpp" } |
| 60 | +attributes #1 = { "sycl-module-id"="b.cpp" } |
| 61 | +attributes #2 = { "sycl-module-id"="c.cpp" } |
| 62 | + |
| 63 | +; Global scope |
| 64 | +; CHECK-GLOBAL-PROP: [SYCL/kernel names] |
| 65 | +; CHECK-GLOBAL-PROP-NEXT: SpirKernel1 |
| 66 | +; CHECK-GLOBAL-PROP-NEXT: SpirKernel2 |
| 67 | +; CHECK-GLOBAL-PROP-NEXT: SpirKernel3 |
| 68 | + |
| 69 | +; Per-module split |
| 70 | +; CHECK-PERMODULE-0-PROP: [SYCL/kernel names] |
| 71 | +; CHECK-PERMODULE-0-PROP-NEXT: SpirKernel1 |
| 72 | +; CHECK-PERMODULE-0-PROP-NEXT: SpirKernel3 |
| 73 | +; CHECK-PERMODULE-0-PROP-NOT: SpirKernel2 |
| 74 | + |
| 75 | +; CHECK-PERMODULE-1-PROP: [SYCL/kernel names] |
| 76 | +; CHECK-PERMODULE-1-PROP-NEXT: SpirKernel2 |
| 77 | +; CHECK-PERMODULE-1-PROP-NOT: SpirKernel1 |
| 78 | +; CHECK-PERMODULE-1-PROP-NOT: SpirKernel3 |
| 79 | + |
| 80 | +; Per-kernel split |
| 81 | +; CHECK-PERKERNEL-0-PROP: [SYCL/kernel names] |
| 82 | +; CHECK-PERKERNEL-0-PROP-NEXT: SpirKernel3 |
| 83 | +; CHECK-PERKERNEL-0-PROP-NOT: SpirKernel1 |
| 84 | +; CHECK-PERKERNEL-0-PROP-NOT: SpirKernel2 |
| 85 | + |
| 86 | +; CHECK-PERKERNEL-1-PROP: [SYCL/kernel names] |
| 87 | +; CHECK-PERKERNEL-1-PROP-NEXT: SpirKernel2 |
| 88 | +; CHECK-PERKERNEL-1-PROP-NOT: SpirKernel1 |
| 89 | +; CHECK-PERKERNEL-1-PROP-NOT: SpirKernel3 |
| 90 | + |
| 91 | +; CHECK-PERKERNEL-2-PROP: [SYCL/kernel names] |
| 92 | +; CHECK-PERKERNEL-2-PROP-NEXT: SpirKernel1 |
| 93 | +; CHECK-PERKERNEL-2-PROP-NOT: SpirKernel2 |
| 94 | +; CHECK-PERKERNEL-2-PROP-NOT: SpirKernel3 |
| 95 | + |
| 96 | +; Kernel-less generated modules should have no kernel names |
| 97 | +; CHECK-KERNELLESS-PROP-NOT: [SYCL/kernel names] |
| 98 | +; CHECK-KERNELLESS-PROP-NOT: SpirKernel1 |
| 99 | +; CHECK-KERNELLESS-PROP-NOT: SpirKernel2 |
| 100 | +; CHECK-KERNELLESS-PROP-NOT: SpirKernel3 |
0 commit comments