Skip to content

Commit bce9b6d

Browse files
authored
[Flang][Flang-Driver]Fix to add atomic control options in non-fc1 mode (#154638)
1 parent c5466c6 commit bce9b6d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,14 @@ void Flang::addTargetOptions(const ArgList &Args,
534534
}
535535

536536
Args.addAllArgs(CmdArgs,
537-
{options::OPT_fverbose_asm, options::OPT_fno_verbose_asm});
537+
{options::OPT_fverbose_asm, options::OPT_fno_verbose_asm,
538+
options::OPT_fatomic_ignore_denormal_mode,
539+
options::OPT_fno_atomic_ignore_denormal_mode,
540+
options::OPT_fatomic_fine_grained_memory,
541+
options::OPT_fno_atomic_fine_grained_memory,
542+
options::OPT_fatomic_remote_memory,
543+
options::OPT_fno_atomic_remote_memory,
544+
options::OPT_munsafe_fp_atomics});
538545
}
539546

540547
void Flang::addOffloadOptions(Compilation &C, const InputInfoList &Inputs,

flang/test/Driver/atomic-control-options.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
! REQUIRES: amdgpu-registered-target
22
! RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -fopenmp -fopenmp-is-device -munsafe-fp-atomics %s -o -|FileCheck -check-prefix=UNSAFE-FP-ATOMICS %s
3+
! RUN: %flang --offload-arch=gfx90a --offload-device-only -fopenmp -emit-llvm -S %s -munsafe-fp-atomics -nogpulib -o -|FileCheck -check-prefix=UNSAFE-FP-ATOMICS %s
34
! RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -fopenmp -fopenmp-is-device -fatomic-ignore-denormal-mode %s -o -|FileCheck -check-prefix=IGNORE-DENORMAL-MODE %s
5+
! RUN: %flang --offload-arch=gfx90a --offload-device-only -fopenmp -emit-llvm -S %s -fatomic-ignore-denormal-mode -nogpulib -o -|FileCheck -check-prefix=IGNORE-DENORMAL-MODE %s
46
! RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -fopenmp -fopenmp-is-device -fatomic-fine-grained-memory %s -o -|FileCheck -check-prefix=FINE-GRAINED-MEMORY %s
7+
! RUN: %flang --offload-arch=gfx90a --offload-device-only -fopenmp -emit-llvm -S %s -fatomic-fine-grained-memory -nogpulib -o -|FileCheck -check-prefix=FINE-GRAINED-MEMORY %s
58
! RUN: %flang_fc1 -emit-llvm -triple amdgcn-amd-amdhsa -fopenmp -fopenmp-is-device -fatomic-remote-memory %s -o -|FileCheck -check-prefix=REMOTE-MEMORY %s
9+
! RUN: %flang --offload-arch=gfx90a --offload-device-only -fopenmp -emit-llvm -S %s -fatomic-remote-memory -nogpulib -o -|FileCheck -check-prefix=REMOTE-MEMORY %s
610
program test
711
implicit none
812
integer :: A, threads

0 commit comments

Comments
 (0)