Skip to content

Commit 38d58ed

Browse files
committed
[NFC][ClangLinkerWrapper] fix tests after 65d730b (#32475)
These new tests are added after 65d730b However, the logic in xmain are still very different from upstream, eg: we skip bundleLinkedOutput for OFK_SYCL, so the dry_run logic for test is not even called. We also have more logic so we require sycl device lib to be not empty, add the fake lib to get it pass.
1 parent 76c41ca commit 38d58ed

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

clang/test/Driver/linker-wrapper-image.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@
267267
// RUN: clang-offload-packager -o %t.out --image=file=%t.elf.o,kind=sycl,triple=spirv64-unknown-unknown,arch=generic
268268
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o \
269269
// RUN: -fembed-offload-object=%t.out
270-
// RUN: clang-linker-wrapper --print-wrapped-module --dry-run --host-triple=x86_64-unknown-linux-gnu \
271-
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefixes=SYCL
272-
// RUN: clang-linker-wrapper --print-wrapped-module --dry-run --host-triple=x86_64-unknown-linux-gnu -r \
273-
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefixes=SYCL
270+
// RUN: clang-linker-wrapper --print-wrapped-module --dry-run --host-triple=x86_64-unknown-linux-gnu -sycl-device-libraries=%t.o \
271+
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefixes=SYCL-INTEL
272+
// RUN: clang-linker-wrapper --print-wrapped-module --dry-run --host-triple=x86_64-unknown-linux-gnu -r -sycl-device-libraries=%t.o \
273+
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefixes=SYCL-INTEL
274+
275+
// SYCL-INTEL: spirv-to-ir-wrapper
274276

275277
// SYCL: %__sycl.tgt_device_image = type { i16, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
276278
// SYCL-NEXT: %__sycl.tgt_bin_desc = type { i16, i16, ptr, ptr, ptr }

clang/test/Driver/linker-wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ __attribute__((visibility("protected"), used)) int x;
5454
// RUN: clang-offload-packager -o %t.out \
5555
// RUN: --image=file=%t.spirv.bc,kind=sycl,triple=spirv64-unknown-unknown,arch=generic
5656
// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out
57-
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run \
57+
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run -sycl-device-libraries=%t.out \
5858
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=SPIRV-LINK-INTEL
5959

6060
// TODO: Remove SPIRV-LINK-INTEL once migration to community flow is completed.

0 commit comments

Comments
 (0)