| 1 |
// Check that clang unbundles the two bitcodes and links via llvm-link |
| 2 |
// RUN: rm -rf %t && mkdir %t |
| 3 |
// RUN: touch %t/bundle1.bc |
| 4 |
// RUN: touch %t/bundle2.bc |
| 5 |
|
| 6 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx906 --hip-link \ |
| 7 |
// RUN: -nogpulib -nogpuinc -emit-llvm -fgpu-rdc --cuda-device-only \ |
| 8 |
// RUN: --no-offload-new-driver %t/bundle1.bc %t/bundle2.bc \ |
| 9 |
// RUN: 2>&1 | FileCheck -check-prefix=BITCODE %s |
| 10 |
|
| 11 |
// BITCODE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906" "-input={{.*}}bundle1.bc" "-output=[[B1HOST:.*\.bc]]" "-output=[[B1DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles" |
| 12 |
// BITCODE: "{{.*}}clang{{.*}}" "-o" "[[B1DEV2:.*bundle1-gfx906-.*\.bc]]" "-x" "ir" "[[B1DEV1]]" |
| 13 |
|
| 14 |
// BITCODE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906" "-input={{.*}}bundle2.bc" "-output=[[B2HOST:.*\.bc]]" "-output=[[B2DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles" |
| 15 |
// BITCODE: "{{.*}}clang{{.*}}" "-o" "[[B2DEV2:.*bundle2-gfx906-.*\.bc]]" "-x" "ir" "[[B2DEV1]]" |
| 16 |
|
| 17 |
// BITCODE: "{{.*}}llvm-link" "-o" "bundle1-hip-amdgcn-amd-amdhsa-gfx906.bc" "[[B1DEV2]]" "[[B2DEV2]]" |
| 18 |
|
| 19 |
// Check that clang unbundles the bitcode and archive and links via llvm-link |
| 20 |
// RUN: llvm-ar rc %t/libhipbundle.a |
| 21 |
// RUN: touch %t/bundle.bc |
| 22 |
|
| 23 |
// RUN: %clang -### --target=x86_64-unknown-linux-gnu --offload-arch=gfx906 --hip-link \ |
| 24 |
// RUN: -nogpulib -nogpuinc -emit-llvm -fgpu-rdc --cuda-device-only \ |
| 25 |
// RUN: --no-offload-new-driver %t/bundle.bc -L%t -lhipbundle \ |
| 26 |
// RUN: 2>&1 | FileCheck -check-prefix=ARCHIVE %s |
| 27 |
|
| 28 |
// ARCHIVE: "{{.*}}clang-offload-bundler" "-type=bc" "-targets=host-x86_64-unknown-linux-gnu,hip-amdgcn-amd-amdhsa-unknown-gfx906" "-input={{.*}}bundle.bc" "-output=[[HOST:.*\.bc]]" "-output=[[DEV1:.*\.bc]]" "-unbundle" "-allow-missing-bundles" |
| 29 |
// ARCHIVE: "{{.*}}clang{{.*}}" "-o" "[[DEV2:.*\.bc]]" "-x" "ir" "[[DEV1]]" |
| 30 |
|
| 31 |
// ARCHIVE: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}libhipbundle.a" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[AR:.*\.a]]" "-allow-missing-bundles" "-hip-openmp-compatible" |
| 32 |
|
| 33 |
// ARCHIVE: "{{.*}}llvm-link" "-o" "bundle-hip-amdgcn-amd-amdhsa-gfx906.bc" "[[DEV2]]" "[[AR]]" |