blob: 03126ae589a09825971706d5e2bf6322b7ae3568 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Test HIPSPV static device library linking
// REQUIRES: system-linux
// UNSUPPORTED: system-windows
// Create a dummy archive to test SDL linking
// RUN: rm -rf %t && mkdir %t
// RUN: touch %t/dummy.bc
// RUN: llvm-ar cr %t/libSDL.a %t/dummy.bc
// Test that -l options are passed to llvm-link for --offload=spirv64
// RUN: %clang -### --target=x86_64-linux-gnu --offload=spirv64 \
// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
// RUN: -L%t -lSDL \
// RUN: 2>&1 | FileCheck -check-prefix=SDL-LINK %s
// Test that .a files are properly unbundled and passed to llvm-link
// RUN: %clang -### --target=x86_64-linux-gnu --offload=spirv64 \
// RUN: --hip-path=%S/Inputs/hipspv -nohipwrapperinc %s \
// RUN: %t/libSDL.a \
// RUN: 2>&1 | FileCheck -check-prefix=SDL-ARCHIVE %s
// Verify that the input files are added before the SDL files in llvm-link command
// This tests the ordering fix to match HIPAMD behavior
// SDL-LINK: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}libSDL.a" "-targets=hip-spirv64-unknown-unknown-unknown-generic" "-output=[[SDL_A:.*\.a]]" "-allow-missing-bundles"
// SDL-LINK: "{{.*}}llvm-link" "{{.*}}.bc" "[[SDL_A]]" "-o"
// SDL-ARCHIVE: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}libSDL.a" "-targets=hip-spirv64-unknown-unknown-unknown-generic" "-output=[[SDL_A:.*\.a]]" "-allow-missing-bundles"
// SDL-ARCHIVE: "{{.*}}llvm-link" "{{.*}}.bc" "[[SDL_A]]" "-o"
|