Skip to content

Commit 354174b

Browse files
authored
Merge pull request #251 from SouraVX/fix-250
Fix for #250
2 parents f8ec664 + a85143b commit 354174b

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "flang/Lower/PFTBuilder.h"
1717
#include "flang/Parser/parse-tree.h"
1818
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
19+
#include "llvm/Frontend/OpenMP/OMPConstants.h"
1920

2021
#define TODO() llvm_unreachable("not yet implemented")
2122

@@ -28,24 +29,24 @@ void Fortran::lower::genOMP(
2829
std::get<Fortran::parser::OmpSimpleStandaloneDirective>(
2930
simpleStandaloneConstruct.t);
3031
switch (directive.v) {
31-
#if 0 // does not compile
32-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::Barrier:
32+
33+
default:
34+
break;
35+
case llvm::omp::Directive::OMPD_barrier:
3336
absConv.getFirOpBuilder().create<mlir::omp::BarrierOp>(
3437
absConv.getCurrentLocation());
3538
break;
36-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::Taskwait:
39+
case llvm::omp::Directive::OMPD_taskwait:
3740
TODO();
38-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::Taskyield:
41+
case llvm::omp::Directive::OMPD_taskyield:
3942
TODO();
40-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::
41-
TargetEnterData:
43+
case llvm::omp::Directive::OMPD_target_enter_data:
4244
TODO();
43-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::TargetExitData:
45+
case llvm::omp::Directive::OMPD_target_exit_data:
4446
TODO();
45-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::TargetUpdate:
47+
case llvm::omp::Directive::OMPD_target_update:
4648
TODO();
47-
case Fortran::parser::OmpSimpleStandaloneDirective::Directive::Ordered:
48-
#endif
49+
case llvm::omp::Directive::OMPD_ordered:
4950
TODO();
5051
}
5152
}

flang/test/Lower/omp-barrier.f90

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
! This test checks lowering of OpenMP Barrier Directive.
22

3-
! https://github.com/flang-compiler/f18-llvm-project/issues/250
4-
! XFAIL: *
5-
63
! RUN: bbc -fopenmp -emit-fir %s -o - | \
74
! RUN: FileCheck %s --check-prefix=FIRDialect
85
! RUN: bbc -fopenmp -emit-llvm %s -o - | \

0 commit comments

Comments
 (0)