[llvm] [OpenMP][Offload] Fix flang offload test (PR #208829)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 01:51:01 PDT 2026
arsenm wrote:
> seems like the driver/toolchain didn't infer the target correctly.
> $BUILD/bin/flang -c -fopenmp --offload-arch=gfx90a \
> $SRC/Inputs/declare-target-common-block-sub.f90 \
> -o sub.bad.o
At this stage the driver should still be using the old amdgcn-amd-amdhsa
>
> $BUILD/bin/flang -fopenmp \
> -I $SRC \
> -I $BUILD/runtimes/runtimes-bins/openmp/runtime/src \
> -L $BUILD/lib/x86_64-unknown-linux-gnu \
> -L $BUILD/lib \
> -L $BUILD/runtimes/runtimes-bins/openmp/runtime/src \
> -Wl,-rpath,$BUILD/lib/x86_64-unknown-linux-gnu \
> -Wl,-rpath,$BUILD/runtimes/runtimes-bins/openmp/runtime/src \
> -Wl,-rpath,$BUILD/lib/x86_64-unknown-linux-gnu \
> -Wl,-rpath,$BUILD/lib \
> -Xoffload-linker -L$BUILD/lib/amdgpu-amd-amdhsa \
> -fopenmp-targets=amdgpu-amd-amdhsa \
> $SRC/offloading/fortran/declare-target-common-block-main.f90 \
> -o fail.out \
> -Xoffload-linker -lompdevice \
> sub.bad.o
The problem here is mixing and matching the old and the new name. This should work in principle, but the current compatibility expectation is a migration will be complete, so this is a test artifact. I have a patch about ready to make this work.
>
> $BUILD/bin/llvm-objcopy --dump-section .llvm.offloading=fail.offload fail.out
> $BUILD/bin/llvm-offload-binary fail.offload \
> --image=file=fail.device.o,arch=gfx90a,triple=amdgpu-amd-amdhsa
>
>
> $BUILD/bin/llvm-readelf -s fail.device.o | grep foo || true
>
> => no symbols about foo.
Missing symbol is a weird failure mode
https://github.com/llvm/llvm-project/pull/208829
More information about the llvm-commits
mailing list