Flang-new needs to add `mlink-builtin-bitcode` objects to properly support offload code generation for AMD GPUs (for example, math functions). Both Flang-new and Clang rely on `mlink-builtin-bitcode` flags. These flags are added by the `AMDGPUOpenMPToolchain::addClangTargetOptions` function. Now, both compilers reuse the same function. Flang-new tests for AMDGPU were updated by adding the `-nogpulib` flag. This flag allows running AMDGPU tests on machines without the ROCm stack.
11 lines
379 B
Fortran
11 lines
379 B
Fortran
! REQUIRES: amdgpu-registered-target
|
|
|
|
! Test that -mcpu are used and that the -target-cpu and -target-features
|
|
! are also added to the fc1 command.
|
|
|
|
! RUN: %flang --target=amdgcn-amd-amdhsa -mcpu=gfx902 -nogpulib -c %s -### 2>&1 \
|
|
! RUN: | FileCheck %s -check-prefix=CHECK-AMDGCN
|
|
|
|
! CHECK-AMDGCN: "-fc1" "-triple" "amdgcn-amd-amdhsa"
|
|
! CHECK-AMDGCN-SAME: "-target-cpu" "gfx902"
|