|
4 | 4 | // COM: compile -> hotswap-rewrite -> verify chain using the in-tree |
5 | 5 | // COM: clang + llvm-readelf + llvm-objdump substitutions. |
6 | 6 | // COM: |
7 | | -// COM: Patches in amd/comgr/src/comgr-hotswap-b0a0.cpp are weak stubs |
8 | | -// COM: returning 0 until the concrete patch .cpp files land, so the |
9 | | -// COM: dispatcher currently emits an output that is bytewise-identical |
10 | | -// COM: to the input. Even with no patches applied we can assert that |
11 | | -// COM: (1) the rewrite returns SUCCESS, (2) the output is a valid |
12 | | -// COM: gfx1250 ELF that preserves the ISA identification, and (3) .text |
13 | | -// COM: is still present and disassemblable as AMDGPU code. The |
14 | | -// COM: per-patch PRs will layer in their own `llvm-objdump | FileCheck` |
15 | | -// COM: stanzas on top of this harness to assert their specific opcode |
16 | | -// COM: changes / trampolines. |
| 7 | +// COM: This kernel intentionally does not contain instructions matched by |
| 8 | +// COM: the current hotswap patch set. The test is still useful as a real |
| 9 | +// COM: code-object smoke test: it asserts that (1) rewrite returns SUCCESS, |
| 10 | +// COM: (2) the output remains a valid gfx1250 ELF with preserved ISA |
| 11 | +// COM: identification, and (3) .text is still present and disassemblable. |
| 12 | +// COM: Patch-specific LIT tests cover opcode changes and trampolines. |
17 | 13 |
|
18 | 14 | // COM: Compile a tiny kernel targeting gfx1250 to a raw code object. |
19 | 15 | // RUN: %clang --offload-arch=gfx1250 --offload-device-only \ |
|
25 | 21 | // RUN: %llvm-readelf -h %t.input.elf | %FileCheck --check-prefix=INPUT-FLAGS %s |
26 | 22 | // INPUT-FLAGS: Flags:{{.*}}gfx1250 |
27 | 23 | // RUN: %llvm-readelf --notes %t.input.elf | %FileCheck --check-prefix=INPUT-META %s |
28 | | -// INPUT-META: amdhsa.target: amdgcn-amd-amdhsa-{{.*}}gfx1250 |
| 24 | +// INPUT-META: amdhsa.target: amdgcn-amd-amdhsa{{--|-unknown-}}gfx1250 |
29 | 25 |
|
30 | 26 | // COM: Run hotswap-rewrite; save the output so we can inspect it. |
31 | 27 | // RUN: AMD_COMGR_HOTSWAP_ENTRY_TRAMPOLINES=0 hotswap-rewrite %t.input.elf \ |
|
34 | 30 | // RUN: | %FileCheck --check-prefix=STATUS %s |
35 | 31 | // STATUS: RESULT: SUCCESS |
36 | 32 |
|
37 | | -// COM: Output ELF is valid and still identifies as gfx1250 (patches are |
38 | | -// COM: weak stubs, so the identity should be preserved untouched; future |
39 | | -// COM: patch PRs that intentionally change the target ISA note will |
40 | | -// COM: update this stanza). |
| 33 | +// COM: Output ELF is valid and still identifies as gfx1250; this smoke |
| 34 | +// COM: kernel has no patch-triggering instructions, so the rewrite should |
| 35 | +// COM: preserve the target identification. |
41 | 36 | // RUN: %llvm-readelf -h %t.output.elf | %FileCheck --check-prefix=OUTPUT-FLAGS %s |
42 | 37 | // OUTPUT-FLAGS: Flags:{{.*}}gfx1250 |
43 | 38 | // RUN: %llvm-readelf --notes %t.output.elf | %FileCheck --check-prefix=OUTPUT-META %s |
44 | | -// OUTPUT-META: amdhsa.target: amdgcn-amd-amdhsa-{{.*}}gfx1250 |
| 39 | +// OUTPUT-META: amdhsa.target: amdgcn-amd-amdhsa{{--|-unknown-}}gfx1250 |
45 | 40 |
|
46 | 41 | // COM: .text section is still present and marked executable. |
47 | 42 | // RUN: %llvm-readelf --section-headers %t.output.elf \ |
|
0 commit comments