llvm-project/flang/test/Parser/omp-atomic-unparse.f90

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

215 lines
4.2 KiB
Fortran
Raw Normal View History

[flang][driver] Add debug options not requiring semantic checks This patch adds two debugging options in the new Flang driver (flang-new): *fdebug-unparse-no-sema *fdebug-dump-parse-tree-no-sema Each of these options combines two options from the "throwaway" driver (left: f18, right: flang-new): * `-fdebug-uparse -fdebug-no-semantics` --> `-fdebug-unparse-no-sema` * `-fdebug-dump-parse-tree -fdebug-no-semantics` --> `-fdebug-dump-parse-tree-no-sema` There are no plans to implement `-fdebug-no-semantics` in the new driver. Such option would be too powerful. Also, it would only make sense when combined with specific frontend actions (`-fdebug-unparse` and `-fdebug-dump-parse-tree`). Instead, this patch adds 2 specialised options listed above. Each of these is implemented through a dedicated FrontendAction (also added). The new frontend actions are implemented in terms of a new abstract base action: `PrescanAndSemaAction`. This new base class was required so that we can have finer control over what steps within the frontend are executed: * `PrescanAction`: run the _prescanner_ * `PrescanAndSemaAction`: run the _prescanner_ and the _parser_ (new in this patch) * `PrescanAndSemaAction`: run the _prescanner_, _parser_ and run the _semantic checks_ This patch introduces `PrescanAndParseAction::BeginSourceFileAction`. Apart from the semantic checks removed at the end, it is similar to `PrescanAndSemaAction::BeginSourceFileAction`. Differential Revision: https://reviews.llvm.org/D99645
2021-03-30 18:35:42 +08:00
! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck %s
program main
implicit none
integer :: i, j = 10
!READ
!$omp atomic read
i = j
!$omp atomic seq_cst read
i = j
!$omp atomic read seq_cst
i = j
!$omp atomic release read
i = j
!$omp atomic read release
i = j
!$omp atomic acq_rel read
i = j
!$omp atomic read acq_rel
i = j
!$omp atomic acquire read
i = j
!$omp atomic read acquire
i = j
!$omp atomic relaxed read
i = j
!$omp atomic read relaxed
i = j
! WRITE
!$omp atomic write
i = j
!$omp atomic seq_cst write
i = j
!$omp atomic write seq_cst
i = j
!$omp atomic release write
i = j
!$omp atomic write release
i = j
!$omp atomic acq_rel write
i = j
!$omp atomic write acq_rel
i = j
!$omp atomic acquire write
i = j
!$omp atomic write acquire
i = j
!$omp atomic relaxed write
i = j
!$omp atomic write relaxed
i = j
!UPDATE
!$omp atomic update
i = j
!$omp atomic seq_cst update
i = j
!$omp atomic update seq_cst
i = j
!$omp atomic release update
i = j
!$omp atomic update release
i = j
!$omp atomic acq_rel update
i = j
!$omp atomic update acq_rel
i = j
!$omp atomic acquire update
i = j
!$omp atomic update acquire
i = j
!$omp atomic relaxed update
i = j
!$omp atomic update relaxed
i = j
!CAPTURE
!$omp atomic capture
i = j
i = j
!$omp end atomic
!$omp atomic seq_cst capture
i = j
i = j
!$omp end atomic
!$omp atomic capture seq_cst
i = j
i = j
!$omp end atomic
!$omp atomic release capture
i = j
i = j
!$omp end atomic
!$omp atomic capture release
i = j
i = j
!$omp end atomic
!$omp atomic acq_rel capture
i = j
i = j
!$omp end atomic
!$omp atomic capture acq_rel
i = j
i = j
!$omp end atomic
!$omp atomic acquire capture
i = j
i = j
!$omp end atomic
!$omp atomic capture acquire
i = j
i = j
!$omp end atomic
!$omp atomic relaxed capture
i = j
i = j
!$omp end atomic
!$omp atomic capture relaxed
i = j
i = j
!$omp end atomic
!ATOMIC
!$omp atomic
i = j
!$omp atomic seq_cst
i = j
!$omp atomic release
i = j
!$omp atomic acq_rel
i = j
!$omp atomic acquire
i = j
!$omp atomic relaxed
i = j
end program main
!CHECK-LABEL: PROGRAM main
!READ
!CHECK: !$OMP ATOMIC READ
!CHECK: !$OMP ATOMIC SEQ_CST READ
!CHECK: !$OMP ATOMIC READ SEQ_CST
!CHECK: !$OMP ATOMIC RELEASE READ
!CHECK: !$OMP ATOMIC READ RELEASE
!CHECK: !$OMP ATOMIC ACQ_REL READ
!CHECK: !$OMP ATOMIC READ ACQ_REL
!CHECK: !$OMP ATOMIC ACQUIRE READ
!CHECK: !$OMP ATOMIC READ ACQUIRE
!CHECK: !$OMP ATOMIC RELAXED READ
!CHECK: !$OMP ATOMIC READ RELAXED
!WRITE
!CHECK: !$OMP ATOMIC WRITE
!CHECK: !$OMP ATOMIC SEQ_CST WRITE
!CHECK: !$OMP ATOMIC WRITE SEQ_CST
!CHECK: !$OMP ATOMIC RELEASE WRITE
!CHECK: !$OMP ATOMIC WRITE RELEASE
!CHECK: !$OMP ATOMIC ACQ_REL WRITE
!CHECK: !$OMP ATOMIC WRITE ACQ_REL
!CHECK: !$OMP ATOMIC ACQUIRE WRITE
!CHECK: !$OMP ATOMIC WRITE ACQUIRE
!CHECK: !$OMP ATOMIC RELAXED WRITE
!CHECK: !$OMP ATOMIC WRITE RELAXED
!UPDATE
!CHECK: !$OMP ATOMIC UPDATE
!CHECK: !$OMP ATOMIC SEQ_CST UPDATE
!CHECK: !$OMP ATOMIC UPDATE SEQ_CST
!CHECK: !$OMP ATOMIC RELEASE UPDATE
!CHECK: !$OMP ATOMIC UPDATE RELEASE
!CHECK: !$OMP ATOMIC ACQ_REL UPDATE
!CHECK: !$OMP ATOMIC UPDATE ACQ_REL
!CHECK: !$OMP ATOMIC ACQUIRE UPDATE
!CHECK: !$OMP ATOMIC UPDATE ACQUIRE
!CHECK: !$OMP ATOMIC RELAXED UPDATE
!CHECK: !$OMP ATOMIC UPDATE RELAXED
!CAPTURE
!CHECK: !$OMP ATOMIC CAPTURE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC SEQ_CST CAPTURE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC CAPTURE SEQ_CST
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC RELEASE CAPTURE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC CAPTURE RELEASE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC ACQ_REL CAPTURE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC CAPTURE ACQ_REL
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC ACQUIRE CAPTURE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC CAPTURE ACQUIRE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC RELAXED CAPTURE
!CHECK: !$OMP END ATOMIC
!CHECK: !$OMP ATOMIC CAPTURE RELAXED
!CHECK: !$OMP END ATOMIC
!ATOMIC
!CHECK: !$OMP ATOMIC
!CHECK: !$OMP ATOMIC SEQ_CST
!CHECK: !$OMP ATOMIC RELEASE
!CHECK: !$OMP ATOMIC ACQ_REL
!CHECK: !$OMP ATOMIC ACQUIRE
!CHECK: !$OMP ATOMIC RELAXED