|
3 | 3 | // REQUIRES: amdgpu-registered-target |
4 | 4 | // UNSUPPORTED: system-windows |
5 | 5 |
|
6 | | -// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.elf.o |
| 6 | +// RUN: rm -rf %t && mkdir -p %t |
| 7 | +// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t/elf.o |
7 | 8 |
|
8 | 9 | // Check that we can extract files from the packaged binary. |
9 | | -// RUN: clang-offload-packager -o %t.out \ |
10 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
11 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_80 \ |
12 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
13 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a \ |
14 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90c |
15 | | -// RUN: clang-offload-packager %t.out \ |
16 | | -// RUN: --image=file=%t-sm_70.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
17 | | -// RUN: --image=file=%t-gfx908.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
18 | | -// RUN: diff %t-sm_70.o %t.elf.o |
19 | | -// RUN: diff %t-gfx908.o %t.elf.o |
| 10 | +// RUN: clang-offload-packager -o %t/package.out \ |
| 11 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
| 12 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_80 \ |
| 13 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
| 14 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a \ |
| 15 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90c |
| 16 | +// RUN: clang-offload-packager %t/package.out \ |
| 17 | +// RUN: --image=file=%t/sm_70.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
| 18 | +// RUN: --image=file=%t/gfx908.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
| 19 | +// RUN: diff %t/sm_70.o %t/elf.o |
| 20 | +// RUN: diff %t/gfx908.o %t/elf.o |
20 | 21 |
|
21 | 22 | // Check that we generate a new name if one is not given |
22 | | -// RUN: clang-offload-packager -o %t \ |
23 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
24 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_80 \ |
25 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
26 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a \ |
27 | | -// RUN: --image=file=%t.elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90c |
28 | | -// RUN: cd $(dirname "%t") && clang-offload-packager %t --image=kind=openmp |
29 | | -// RUN: diff *-nvptx64-nvidia-cuda-sm_70.0.o %t.elf.o; rm *-nvptx64-nvidia-cuda-sm_70.0.o |
30 | | -// RUN: diff *-nvptx64-nvidia-cuda-sm_80.1.o %t.elf.o; rm *-nvptx64-nvidia-cuda-sm_80.1.o |
31 | | -// RUN: diff *-amdgcn-amd-amdhsa-gfx908.2.o %t.elf.o; rm *-amdgcn-amd-amdhsa-gfx908.2.o |
32 | | -// RUN: diff *-amdgcn-amd-amdhsa-gfx90a.3.o %t.elf.o; rm *-amdgcn-amd-amdhsa-gfx90a.3.o |
33 | | -// RUN: not diff *-amdgcn-amd-amdhsa-gfx90c.4.o %t.elf.o |
| 23 | +// RUN: clang-offload-packager -o %t/package \ |
| 24 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
| 25 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_80 \ |
| 26 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
| 27 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx90a \ |
| 28 | +// RUN: --image=file=%t/elf.o,kind=hip,triple=amdgcn-amd-amdhsa,arch=gfx90c |
| 29 | +// RUN: cd %t && clang-offload-packager %t/package --image=kind=openmp |
| 30 | +// RUN: diff *-nvptx64-nvidia-cuda-sm_70.0.o %t/elf.o; rm *-nvptx64-nvidia-cuda-sm_70.0.o |
| 31 | +// RUN: diff *-nvptx64-nvidia-cuda-sm_80.1.o %t/elf.o; rm *-nvptx64-nvidia-cuda-sm_80.1.o |
| 32 | +// RUN: diff *-amdgcn-amd-amdhsa-gfx908.2.o %t/elf.o; rm *-amdgcn-amd-amdhsa-gfx908.2.o |
| 33 | +// RUN: diff *-amdgcn-amd-amdhsa-gfx90a.3.o %t/elf.o; rm *-amdgcn-amd-amdhsa-gfx90a.3.o |
| 34 | +// RUN: not diff *-amdgcn-amd-amdhsa-gfx90c.4.o %t/elf.o |
34 | 35 |
|
35 | 36 | // Check that we can extract from an ELF object file |
36 | | -// RUN: clang-offload-packager -o %t.out \ |
37 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
38 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
39 | | -// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out |
40 | | -// RUN: clang-offload-packager %t.out \ |
41 | | -// RUN: --image=file=%t-sm_70.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
42 | | -// RUN: --image=file=%t-gfx908.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
43 | | -// RUN: diff %t-sm_70.o %t.elf.o |
44 | | -// RUN: diff %t-gfx908.o %t.elf.o |
| 37 | +// RUN: clang-offload-packager -o %t/package.out \ |
| 38 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
| 39 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
| 40 | +// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t/package.o -fembed-offload-object=%t/package.out |
| 41 | +// RUN: clang-offload-packager %t/package.out \ |
| 42 | +// RUN: --image=file=%t/sm_70.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
| 43 | +// RUN: --image=file=%t/gfx908.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
| 44 | +// RUN: diff %t/sm_70.o %t/elf.o |
| 45 | +// RUN: diff %t/gfx908.o %t/elf.o |
45 | 46 |
|
46 | 47 | // Check that we can extract from a bitcode file |
47 | | -// RUN: clang-offload-packager -o %t.out \ |
48 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
49 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
50 | | -// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -o %t.bc -fembed-offload-object=%t.out |
51 | | -// RUN: clang-offload-packager %t.out \ |
52 | | -// RUN: --image=file=%t-sm_70.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
53 | | -// RUN: --image=file=%t-gfx908.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
54 | | -// RUN: diff %t-sm_70.o %t.elf.o |
55 | | -// RUN: diff %t-gfx908.o %t.elf.o |
| 48 | +// RUN: clang-offload-packager -o %t/package.out \ |
| 49 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
| 50 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
| 51 | +// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-llvm -o %t/package.bc -fembed-offload-object=%t/package.out |
| 52 | +// RUN: clang-offload-packager %t/package.out \ |
| 53 | +// RUN: --image=file=%t/sm_70.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 \ |
| 54 | +// RUN: --image=file=%t/gfx908.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 |
| 55 | +// RUN: diff %t/sm_70.o %t/elf.o |
| 56 | +// RUN: diff %t/gfx908.o %t/elf.o |
56 | 57 |
|
57 | 58 | // Check that we can extract from an archive file to an archive file. |
58 | | -// RUN: clang-offload-packager -o %t.out \ |
59 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
60 | | -// RUN: --image=file=%t.elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
61 | | -// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t.o -fembed-offload-object=%t.out |
62 | | -// RUN: llvm-ar rcs %t.a %t.o |
63 | | -// RUN: clang-offload-packager %t.a --archive --image=file=%t-gfx908.a,arch=gfx908 |
64 | | -// RUN: llvm-ar t %t-gfx908.a 2>&1 | FileCheck %s |
| 59 | +// RUN: clang-offload-packager -o %t/package.out \ |
| 60 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=amdgcn-amd-amdhsa,arch=gfx908 \ |
| 61 | +// RUN: --image=file=%t/elf.o,kind=openmp,triple=nvptx64-nvidia-cuda,arch=sm_70 |
| 62 | +// RUN: %clang -cc1 %s -triple x86_64-unknown-linux-gnu -emit-obj -o %t/package.o -fembed-offload-object=%t/package.out |
| 63 | +// RUN: llvm-ar rcs %t/package.a %t/package.o |
| 64 | +// RUN: clang-offload-packager %t/package.a --archive --image=file=%t/gfx908.a,arch=gfx908 |
| 65 | +// RUN: llvm-ar t %t/gfx908.a 2>&1 | FileCheck %s |
65 | 66 | // CHECK: {{.*}}.o |
0 commit comments