From de4b9a1449e2a0f791f7b0e9c81c14859cef574a Mon Sep 17 00:00:00 2001 From: Dan Palermo Date: Thu, 26 Sep 2024 19:23:00 -0500 Subject: [PATCH] Fix lit tests & update version in Frontend/CompilerInvocation.cpp --- flang/lib/Frontend/CompilerInvocation.cpp | 4 ++-- flang/test/Driver/bbc-openmp-version-macro.f90 | 2 +- flang/test/Lower/OpenMP/rtl-flags.f90 | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index f1fdbb73e14aea..1aa7ce0589b754 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -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( diff --git a/flang/test/Driver/bbc-openmp-version-macro.f90 b/flang/test/Driver/bbc-openmp-version-macro.f90 index 7118021cba03ad..31eb1289b2e926 100644 --- a/flang/test/Driver/bbc-openmp-version-macro.f90 +++ b/flang/test/Driver/bbc-openmp-version-macro.f90 @@ -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 diff --git a/flang/test/Lower/OpenMP/rtl-flags.f90 b/flang/test/Lower/OpenMP/rtl-flags.f90 index b38a6af0d7e3eb..353a7854158605 100644 --- a/flang/test/Lower/OpenMP/rtl-flags.f90 +++ b/flang/test/Lower/OpenMP/rtl-flags.f90 @@ -20,7 +20,7 @@ !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 +!DEFAULT-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags !DEFAULT-DEVICE-FIR-SAME: omp.is_target_device = true !DEFAULT-DEVICE-FIR-VERSION: module attributes {{{.*}}omp.flags = #omp.flags !DEFAULT-DEVICE-FIR-VERSION-SAME: omp.is_target_device = true @@ -28,12 +28,12 @@ !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 -!DBG-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags -!DBG-EQ-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags -!TEAMS-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags -!THREAD-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags -!THREAD-STATE-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags -!NEST-PAR-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags -!ALL-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!DBG-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!DBG-EQ-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!TEAMS-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!THREAD-OSUB-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!THREAD-STATE-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!NEST-PAR-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags +!ALL-DEVICE-FIR: module attributes {{{.*}}omp.flags = #omp.flags subroutine omp_subroutine() end subroutine omp_subroutine