xref: /llvm-project/flang/test/Lower/pre-fir-tree05.f90 (revision 026a43f6cf9f9fe3fb3fcf7065393ebc979afdef)
1! RUN: %flang_fc1 -fdebug-pre-fir-tree -fopenacc %s | FileCheck %s
2
3! Test structure of the Pre-FIR tree with OpenACC construct
4
5! CHECK: Subroutine foo
6subroutine foo()
7  ! CHECK-NEXT: <<OpenACCConstruct>>
8  ! CHECK-NEXT: <<OpenACCConstruct>>
9  !$acc parallel
10  !$acc loop
11  ! CHECK-NEXT: <<DoConstruct>>
12  ! CHECK-NEXT: NonLabelDoStmt
13  do i=1,5
14    ! CHECK-NEXT: PrintStmt
15    print *, "hey"
16    ! CHECK-NEXT: <<DoConstruct>>
17    ! CHECK-NEXT: NonLabelDoStmt
18    do j=1,5
19      ! CHECK-NEXT: PrintStmt
20      print *, "hello", i, j
21    ! CHECK-NEXT: EndDoStmt
22    ! CHECK-NEXT: <<End DoConstruct>>
23    end do
24  ! CHECK-NEXT: EndDoStmt
25  ! CHECK-NEXT: <<End DoConstruct>>
26  end do
27  ! CHECK-NEXT: ContinueStmt
28  !$acc end parallel
29  ! CHECK-NEXT:      <<End OpenACCConstruct>>
30  ! CHECK-NEXT: <<End OpenACCConstruct>>
31  ! CHECK-NEXT: EndSubroutineStmt
32end subroutine
33! CHECK-NEXT: End Subroutine foo
34
35! CHECK: Subroutine foo2
36subroutine foo2()
37  ! CHECK-NEXT: <<OpenACCConstruct>>
38  !$acc parallel loop
39  ! CHECK-NEXT: <<DoConstruct>>
40  ! CHECK-NEXT: NonLabelDoStmt
41  do i=1,5
42  ! CHECK-NEXT: EndDoStmt
43  ! CHECK-NEXT: <<End DoConstruct>>
44  end do
45  ! CHECK-NEXT: ContinueStmt
46  !$acc end parallel loop
47  ! CHECK-NEXT: <<End OpenACCConstruct>>
48  ! CHECK-NEXT: EndSubroutineStmt
49end subroutine
50! CHECK-NEXT: End Subroutine foo2
51