================
@@ -65,6 +65,121 @@ __attribute__((visibility("protected"), used)) int x;
// SPIRV-LINK: clang{{.*}} -o {{.*}}.img -dumpdir a.out.spirv64.foo.img.
--target=spirv64-unknown-unknown -march=foo {{.*}}.o --sycl-link{{$}}
+// SYCL images with the same IGCA target and the same "code" list are linked
+// together and compiled ahead of time for the devices in the list. Images with
+// a different "code" list are linked separately.
+// RUN: llvm-offload-binary -o %t.sycl-u.out \
+// RUN:
--image=file=%t.spirv.bc,kind=sycl,triple=spirv64-unknown-unknown,arch=igca_30r,code=xe-mtl-u
+// RUN: llvm-offload-binary -o %t.sycl-uh.out \
+// RUN:
--image=file=%t.spirv.bc,kind=sycl,triple=spirv64-unknown-unknown,arch=igca_30r,code=xe-mtl-u,code=xe-mtl-h
+// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o
%t.sycl-u.o -fembed-offload-object=%t.sycl-u.out
+// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o
%t.sycl-uh-a.o -fembed-offload-object=%t.sycl-uh.out
+// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o
%t.sycl-uh-b.o -fembed-offload-object=%t.sycl-uh.out
+// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \
+// RUN: --linker-path=/usr/bin/ld %t.sycl-uh-a.o %t.sycl-uh-b.o -o a.out
2>&1 \
+// RUN: | FileCheck %s --check-prefix=SYCL-SAME-CODE
+// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \
+// RUN: --linker-path=/usr/bin/ld %t.sycl-u.o %t.sycl-uh-a.o -o a.out 2>&1 \
+// RUN: | FileCheck %s --check-prefix=SYCL-DIFFERENT-CODE
+// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \
+// RUN: --save-temps --linker-path=/usr/bin/ld %t.sycl-u.o %t.sycl-uh-a.o \
+// RUN: -o a.out 2>&1 | FileCheck %s --check-prefix=SYCL-SAVE-TEMPS
+// RUN: llvm-offload-binary -o %t.sycl-generic.out \
+// RUN:
--image=file=%t.spirv.bc,kind=sycl,triple=spirv64-unknown-unknown,arch=generic
+// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o
%t.sycl-generic.o -fembed-offload-object=%t.sycl-generic.out
+// RUN: rm -f %t.sycl-generic.a
+// RUN: llvm-ar rcs %t.sycl-generic.a %t.sycl-generic.o
+// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \
+// RUN: --linker-path=/usr/bin/ld %t.sycl-u.o %t.sycl-generic.a -o a.out
2>&1 \
+// RUN: | FileCheck %s --check-prefix=SYCL-GENERIC-ARCHIVE
+// RUN: rm -f %t.sycl-u.a
+// RUN: llvm-ar rcs %t.sycl-u.a %t.sycl-u.o
----------------
sarnex wrote:
is it also worth testing a static archive with two objects with different
non-empty `code` values? or do you feel there's nothing special there to test?
https://github.com/llvm/llvm-project/pull/239010
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits