File: hip-link-bundle-archive.hip

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (86 lines) | stat: -rw-r--r-- 5,246 bytes parent folder | download | duplicates (4)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Check clang unbundle the archive and link them by lld.
// If there is a directory which has the same name as the
// value of the '-l' option, it should not interfere with
// the discovery and unbundling of the archive.

// RUN: rm -rf %t hipBundled && mkdir %t hipBundled
// RUN: touch %t/dummy.bc
// RUN: llvm-ar cr %t/libhipBundled.a %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled \
// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-L %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 -nogpuinc \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libhipBundled.a \
// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-LA %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a \
// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-A %s

// RUN: llvm-ar cr %t/libhipBundled.a.5.2 %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a.5.2 \
// RUN:   2>&1 | FileCheck -check-prefixes=GNU,GNU2,GNU-A %s

// Check if a file is not an archive, it is not unbundled.

// RUN: touch %t/libNonArchive.a
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lNonArchive \
// RUN:   2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libNonArchive.a \
// RUN:   2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t libNonArchive.a \
// RUN:   2>&1 | FileCheck -check-prefixes=NONARCHIVE %s

// Check if a file does not exist, it is not unbundled.

// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/NoneExist.a \
// RUN:   2>&1 | FileCheck -check-prefixes=NONE %s

// Check unbundling archive for MSVC.

// RUN: llvm-ar cr %t/hipBundled2.lib %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled2 \
// RUN:   2>&1 | FileCheck -check-prefix=MSVC %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:hipBundled2.lib \
// RUN:   2>&1 | FileCheck -check-prefix=MSVC %s

// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN:   --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN:   -nogpuinc -nogpulib %s -fgpu-rdc %t/hipBundled2.lib \
// RUN:   2>&1 | FileCheck -check-prefix=MSVC %s

// GNU1: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a]]" "-targets=hip-amdgcn-amd-amdhsa-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
// GNU2: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a\.5\.2]]" "-targets=hip-amdgcn-amd-amdhsa-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"
// GNU: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB]]" "-targets=hip-amdgcn-amd-amdhsa-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"
// GNU-L: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-lhipBundled"
// GNU-LA: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-l:libhipBundled.a"
// GNU-A: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" "{{.*}}[[LIB]]"
// NONARCHIVE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*libNonArchive\.a}}"
// NONE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*NoneExist\.a}}"

// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"
// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"
// MSVC: "{{.*}}link{{.*}}" {{.*}}"-out:a.exe" {{.*}}hipBundled2.lib"