1 // REQUIRES: zlib && !zstd
3 // Test compress bundled bitcode.
6 // RUN: %clang -c -v --target=x86_64-linux-gnu \
7 // RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
8 // RUN: --no-offload-new-driver -fgpu-rdc -nogpuinc -nogpulib \
9 // RUN: %S/Inputs/hip_multiple_inputs/a.cu \
10 // RUN: --offload-compress --offload-compression-level=9 \
11 // RUN: --offload-device-only --gpu-bundle-output \
13 // RUN: 2>&1 | FileCheck %s
15 // CHECK: clang-offload-bundler{{.*}} -type=bc
16 // CHECK-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-gfx1100,hip-amdgcn-amd-amdhsa-gfx1101
17 // CHECK-SAME: -compress -verbose -compression-level=9
18 // CHECK: Compressed bundle format
20 // Test uncompress of bundled bitcode.
22 // RUN: %clang --hip-link -### -v --target=x86_64-linux-gnu \
23 // RUN: --offload-arch=gfx1100 --offload-arch=gfx1101 \
24 // RUN: --no-offload-new-driver -fgpu-rdc -nogpulib \
25 // RUN: %t.bc --offload-device-only \
26 // RUN: 2>&1 | FileCheck -check-prefix=UNBUNDLE %s
28 // UNBUNDLE: clang-offload-bundler{{.*}} "-type=bc"
29 // UNBUNDLE-SAME: -targets={{.*}}hip-amdgcn-amd-amdhsa-gfx1100,hip-amdgcn-amd-amdhsa-gfx1101
30 // UNBUNDLE-SAME: -unbundle
31 // UNBUNDLE-SAME: -verbose
33 // Test compress bundled code objects.
35 // RUN: %clang -c -### -v --target=x86_64-linux-gnu \
36 // RUN: -x hip --offload-arch=gfx1100 --offload-arch=gfx1101 \
37 // RUN: --no-offload-new-driver -nogpuinc -nogpulib \
38 // RUN: %S/Inputs/hip_multiple_inputs/a.cu \
39 // RUN: --offload-compress \
40 // RUN: 2>&1 | FileCheck -check-prefix=CO %s
42 // CO: clang-offload-bundler{{.*}} "-type=o"
43 // CO-SAME: -targets={{.*}}hipv4-amdgcn-amd-amdhsa--gfx1100,hipv4-amdgcn-amd-amdhsa--gfx1101
44 // CO-SAME: "-compress" "-verbose"