[OffloadBundler] Compress bundles over 4GB (#122307)
[llvm-project.git] / flang / test / Parser / acc-unparse.f90
blob62e0d4487f3f745da44fc964b9fe28c1c971be65
1 ! RUN: %flang_fc1 -fopenacc -fdebug-unparse %s | FileCheck %s
3 ! Test unparse does not crash with OpenACC directives.
5 ! Test bug 47659
6 program bug47659
7 integer :: i, j
8 label1: do i = 1, 10
9 !$acc parallel loop
10 do j = 1, 10
11 if (j == 2) then
12 stop 1
13 end if
14 end do
15 end do label1
16 end program
18 !CHECK-LABEL: PROGRAM bug47659
19 !CHECK: !$ACC PARALLEL LOOP
22 subroutine acc_loop()
23 integer :: i, j
24 real :: a(10)
25 integer :: gangNum, gangDim, gangStatic
27 !CHECK-LABEL: SUBROUTINE acc_loop
29 !$acc loop collapse(force: 2)
30 do i = 1, 10
31 do j = 1, 10
32 end do
33 end do
34 !CHECK: !$ACC LOOP COLLAPSE(FORCE:2_4)
36 !$acc loop gang
37 do i = 1, 10
38 a(i) = i
39 end do
40 ! CHECK: !$ACC LOOP GANG
42 !$acc loop gang(gangNum)
43 do i = 1, 10
44 a(i) = i
45 end do
46 ! CHECK: !$ACC LOOP GANG(NUM:gangnum)
48 !$acc loop gang(num: gangNum)
49 do i = 1, 10
50 a(i) = i
51 end do
52 ! CHECK: !$ACC LOOP GANG(NUM:gangnum)
54 !$acc loop gang(dim: gangDim)
55 do i = 1, 10
56 a(i) = i
57 end do
58 ! CHECK: !$ACC LOOP GANG(DIM:gangdim)
60 !$acc loop gang(static:gangStatic)
61 do i = 1, 10
62 a(i) = i
63 end do
64 ! CHECK: !$ACC LOOP GANG(STATIC:gangstatic)
66 !$acc loop gang(static:*)
67 do i = 1, 10
68 a(i) = i
69 end do
70 ! CHECK: !$ACC LOOP GANG(STATIC:*)
72 !$acc loop gang(static:gangStatic, dim: gangDim)
73 do i = 1, 10
74 a(i) = i
75 end do
76 ! CHECK: !$ACC LOOP GANG(STATIC:gangstatic,DIM:gangdim)
78 end subroutine
80 subroutine routine1()
81 !$acc routine bind("routine1_")
82 ! CHECK: !$ACC ROUTINE BIND("routine1_")
83 end subroutine
85 subroutine routine2()
86 !$acc routine(routine2) bind(routine2)
87 ! CHECK: !$ACC ROUTINE(routine2) BIND(routine2)
88 end subroutine