| 1 |
// REQUIRES: x86-registered-target |
| 2 |
// REQUIRES: asserts |
| 3 |
// UNSUPPORTED: target={{.*}}-macosx{{.*}}, target={{.*}}-darwin{{.*}}, target={{.*}}-aix{{.*}}, target={{.*}}-zos{{.*}} |
| 4 |
// REQUIRES: asserts |
| 5 |
|
| 6 |
// Generate the file we can bundle. |
| 7 |
// RUN: %clang -O0 -target %itanium_abi_triple %s -c -o %t.o |
| 8 |
|
| 9 |
// |
| 10 |
// Generate a couple of files to bundle with. |
| 11 |
// |
| 12 |
// RUN: echo 'Content of device file 1' > %t.tgt1 |
| 13 |
// RUN: echo 'Content of device file 2' > %t.tgt2 |
| 14 |
// RUN: echo 'Content of device file 3' > %t.tgt3 |
| 15 |
// |
| 16 |
// Check code object compatibility for archive unbundling |
| 17 |
// |
| 18 |
// Create an object bundle |
| 19 |
// RUN: clang-offload-bundler -type=o -targets=host-%itanium_abi_triple,hip-amdgcn-amd-amdhsa--gfx906,hip-amdgcn-amd-amdhsa--gfx908,hip-spirv64-amd-amdhsa--amdgcnspirv -input=%t.o -input=%t.tgt1 -input=%t.tgt2 -input=%t.tgt3 -output=%t.bundle |
| 20 |
|
| 21 |
// RUN: clang-offload-bundler -unbundle -type=o -targets=hip-amdgcn-amd-amdhsa--gfx906,hip-amdgcn-amd-amdhsa--gfx908,hip-spirv64-amd-amdhsa--amdgcnspirv -input=%t.bundle -output=%t-hip-amdgcn-amd-amdhsa--gfx906.bc -output=%t-hip-amdgcn-amd-amdhsa--gfx908.bc -output=%t-hip-spirv64-amd-amdhsa--amdgcnspirv.bc -debug-only=CodeObjectCompatibility 2>&1 | FileCheck %s -check-prefix=BUNDLE |
| 22 |
// BUNDLE: Compatible: Exact match: [CodeObject: hip-amdgcn-amd-amdhsa--gfx906] : [Target: hip-amdgcn-amd-amdhsa--gfx906] |
| 23 |
// BUNDLE: Compatible: Exact match: [CodeObject: hip-amdgcn-amd-amdhsa--gfx908] : [Target: hip-amdgcn-amd-amdhsa--gfx908] |
| 24 |
// BUNDLE: Compatible: Exact match: [CodeObject: hip-spirv64-amd-amdhsa--amdgcnspirv] : [Target: hip-spirv64-amd-amdhsa--amdgcnspirv] |
| 25 |
|
| 26 |
// Some code so that we can create a binary out of this file. |
| 27 |
int A = 0; |
| 28 |
void test_func(void) { |
| 29 |
++A; |
| 30 |
} |