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