Skip to content

Commit

Permalink
Fix lit tests & update version in Frontend/CompilerInvocation.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
dpalermo committed Sep 27, 2024
1 parent 8c77676 commit de4b9a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions flang/lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
unsigned numErrorsBefore = diags.getNumErrors();
llvm::Triple t(res.getTargetOpts().triple);

// By default OpenMP is set to 1.1 version
res.getLangOpts().OpenMPVersion = 11;
// By default OpenMP is set to 5.2 version
res.getLangOpts().OpenMPVersion = 52;
res.getFrontendOpts().features.Enable(
Fortran::common::LanguageFeature::OpenMP);
if (int Version = getLastArgIntValue(
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Driver/bbc-openmp-version-macro.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
! RUN: bbc -fopenmp -fopenmp-version=51 -o - %s | FileCheck %s --check-prefix=OPENMP-VERSION-51
! RUN: bbc -fopenmp -fopenmp-version=52 -o - %s | FileCheck %s --check-prefix=OPENMP-VERSION-52

! DEFAULT-OPENMP-VERSION: {{.*}} = arith.constant 199911 : i32
! DEFAULT-OPENMP-VERSION: {{.*}} = arith.constant 202111 : i32
! OPENMP-VERSION-11: {{.*}} = arith.constant 199911 : i32
! OPENMP-VERSION-20: {{.*}} = arith.constant 200011 : i32
! OPENMP-VERSION-25: {{.*}} = arith.constant 200505 : i32
Expand Down
16 changes: 8 additions & 8 deletions flang/test/Lower/OpenMP/rtl-flags.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-assume-no-nested-parallelism -fopenmp-is-target-device -o - %s | FileCheck %s --check-prefix=NEST-PAR-DEVICE-FIR
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-target-debug=1 -fopenmp-assume-teams-oversubscription -fopenmp-assume-no-nested-parallelism -fopenmp-assume-threads-oversubscription -fopenmp-assume-no-thread-state -fopenmp-is-target-device -o - %s | FileCheck %s --check-prefix=ALL-DEVICE-FIR

!DEFAULT-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<openmp_device_version = 11>
!DEFAULT-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<openmp_device_version = 52>
!DEFAULT-DEVICE-FIR-SAME: omp.is_target_device = true
!DEFAULT-DEVICE-FIR-VERSION: module attributes {{{.*}}omp.flags = #omp.flags<openmp_device_version = 45>
!DEFAULT-DEVICE-FIR-VERSION-SAME: omp.is_target_device = true
!DEFAULT-DEVICE-FIR-VERSION-SAME: omp.version = #omp.version<version = 45>
!DEFAULT-HOST-FIR: module attributes {{{.*}}omp.is_target_device = false{{.*}}
!DEFAULT-HOST-FIR-VERSION: module attributes {{{.*}}omp.is_target_device = false
!DEFAULT-HOST-FIR-VERSION-SAME: omp.version = #omp.version<version = 45>
!DBG-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, openmp_device_version = 11>
!DBG-EQ-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 111, openmp_device_version = 11>
!TEAMS-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_teams_oversubscription = true, openmp_device_version = 11>
!THREAD-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_threads_oversubscription = true, openmp_device_version = 11>
!THREAD-STATE-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_thread_state = true, openmp_device_version = 11>
!NEST-PAR-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_nested_parallelism = true, openmp_device_version = 11>
!ALL-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, assume_teams_oversubscription = true, assume_threads_oversubscription = true, assume_no_thread_state = true, assume_no_nested_parallelism = true, openmp_device_version = 11>
!DBG-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, openmp_device_version = 52>
!DBG-EQ-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 111, openmp_device_version = 52>
!TEAMS-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_teams_oversubscription = true, openmp_device_version = 52>
!THREAD-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_threads_oversubscription = true, openmp_device_version = 52>
!THREAD-STATE-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_thread_state = true, openmp_device_version = 52>
!NEST-PAR-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<assume_no_nested_parallelism = true, openmp_device_version = 52>
!ALL-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags<debug_kind = 1, assume_teams_oversubscription = true, assume_threads_oversubscription = true, assume_no_thread_state = true, assume_no_nested_parallelism = true, openmp_device_version = 52>
subroutine omp_subroutine()
end subroutine omp_subroutine

0 comments on commit de4b9a1

Please sign in to comment.