Files
clang-p2996/flang/test/Driver/code-object-version.f90
Sergio Afonso a17d49687a [Flang][Driver][AMDGPU] Fix -mcode-object-version (#134230)
This patch updates flang to follow clang's behavior when processing the
`-mcode-object-version` option.

It is now used to populate an LLVM module flag called
`amdhsa_code_object_version` expected by the backend and also updates
the driver to add the `--amdhsa-code-object-version` option to the
frontend invocation for device compilation of AMDGPU targets.
2025-04-04 11:54:49 +01:00

17 lines
897 B
Fortran

! REQUIRES: x86-registered-target, amdgpu-registered-target
! RUN: not %flang -target amdgcn-amd-amdhsa -target-cpu gfx908 -mcode-object-version=3 -S %s -o \
! RUN: /dev/null 2>&1 | FileCheck --check-prefix=INVALID_VERSION %s
! RUN: %flang -target x86_64-unknown-linux-gnu -mcode-object-version=3 -S %s -o \
! RUN: /dev/null 2>&1 | FileCheck --check-prefix=UNUSED_PARAM %s
! RUN: %flang -target amdgcn-amd-amdhsa -mcpu=gfx908 -mcode-object-version=5 -nogpulib -c %s -### 2>&1 \
! RUN: | FileCheck %s -check-prefix=VALID_USE
! INVALID_VERSION: error: invalid integral value '3' in '-mcode-object-version=3'
! UNUSED_PARAM: warning: argument unused during compilation: '-mcode-object-version=3' [-Wunused-command-line-argument]
! VALID_USE: "-fc1" "-triple" "amdgcn-amd-amdhsa"
! VALID_USE-SAME: "-mcode-object-version=5"
! VALID_USE-SAME: "-mllvm" "--amdhsa-code-object-version=5"