1! { dg-do compile }
2
3program asyncwait
4  integer, parameter :: N = 64
5  real, allocatable :: a(:), b(:)
6  integer i
7
8  allocate (a(N))
9  allocate (b(N))
10
11  a(:) = 3.0
12  b(:) = 0.0
13
14  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1 2) ! { dg-error "Failed to match clause" }
15  do i = 1, N
16     b(i) = a(i)
17  end do
18  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
19
20  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1,) ! { dg-error "Failed to match clause" }
21  do i = 1, N
22     b(i) = a(i)
23  end do
24  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
25
26  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (,1) ! { dg-error "Invalid character in name" }
27  do i = 1, N
28     b(i) = a(i)
29  end do
30  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
31
32  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1,2,) ! { dg-error "Failed to match clause" }
33  do i = 1, N
34     b(i) = a(i)
35  end do
36  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
37
38  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1,2 3) ! { dg-error "Failed to match clause" }
39  do i = 1, N
40     b(i) = a(i)
41  end do
42  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
43
44  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1,2,,) ! { dg-error "Failed to match clause" }
45  do i = 1, N
46     b(i) = a(i)
47  end do
48  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
49
50  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1  ! { dg-error "Failed to match clause" }
51  do i = 1, N
52     b(i) = a(i)
53  end do
54  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
55
56  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (*) ! { dg-error "Invalid character in name at" }
57  do i = 1, N
58     b(i) = a(i)
59  end do
60  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
61
62  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (a) ! { dg-error "ASYNC clause at \\\(1\\\) requires a scalar INTEGER expression" }
63  do i = 1, N
64     b(i) = a(i)
65  end do
66  !$acc end parallel
67
68  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (N)
69  do i = 1, N
70     b(i) = a(i)
71  end do
72  !$acc end parallel
73
74  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async (1.0) ! { dg-error "ASYNC clause at \\\(1\\\) requires a scalar INTEGER expression" }
75  do i = 1, N
76     b(i) = a(i)
77  end do
78  !$acc end parallel
79
80  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async () ! { dg-error "Invalid character in name at " }
81  do i = 1, N
82     b(i) = a(i)
83  end do
84  !$acc end parallel ! { dg-error "Unexpected \\\!\\\$ACC END PARALLEL" }
85
86  !$acc parallel copyin (a(1:N)) copy (b(1:N)) async
87  do i = 1, N
88     b(i) = a(i)
89  end do
90  !$acc end parallel
91end program asyncwait
92