1! { dg-do compile }
2
3subroutine bar
4  integer :: i, v
5  real :: f
6  !$omp atomic update acq_rel hint("abc") ! { dg-error "OMP ATOMIC UPDATE at .1. incompatible with ACQ_REL or ACQUIRE clauses" }
7    ! { dg-error "HINT clause at .1. requires a scalar INTEGER expression" "" { target *-*-* } .-1 }
8    ! { dg-error "Value of HINT clause at .1. shall be a valid constant hint expression" "" { target *-*-* } .-2 }
9    i = i + 1
10  !$omp end atomic
11
12  !$omp atomic acq_rel ! { dg-error "OMP ATOMIC UPDATE at .1. incompatible with ACQ_REL or ACQUIRE clauses" }
13  i = i + 1
14  !$omp end atomic
15
16  !$omp atomic capture,acq_rel , hint (1)
17  i = i + 1
18  v = i
19  !$omp end atomic
20
21  !$omp atomic acq_rel , hint (1), update ! { dg-error "OMP ATOMIC UPDATE at .1. incompatible with ACQ_REL or ACQUIRE clauses" }
22  i = i + 1
23  !$omp end atomic
24
25  !$omp atomic hint(0),acquire capture
26  i = i + 1
27  v = i
28  !$omp end atomic
29
30  !$omp atomic write capture ! { dg-error "multiple atomic clauses" }
31  i = 2
32  v = i
33  !$omp end atomic
34
35  !$omp atomic foobar ! { dg-error "Failed to match clause" }
36end
37
38! moved here from atomic.f90
39subroutine openmp51_foo
40  integer :: x, v
41  !$omp atomic update seq_cst capture  ! { dg-error "multiple atomic clauses" }
42  x = x + 2
43  v = x
44  !$omp end atomic
45  !$omp atomic seq_cst, capture, update  ! { dg-error "multiple atomic clauses" }
46  x = x + 2
47  v = x
48  !$omp end atomic
49  !$omp atomic capture, seq_cst ,update  ! { dg-error "multiple atomic clauses" }
50  x = x + 2
51  v = x
52  !$omp end atomic
53end
54
55subroutine openmp51_bar
56  integer :: i, v
57  real :: f
58  !$omp atomic relaxed capture update  ! { dg-error "multiple atomic clauses" }
59  i = i + 1
60  v = i
61  !$omp end atomic
62  !$omp atomic update capture,release , hint (1)  ! { dg-error "multiple atomic clauses" }
63  i = i + 1
64  v = i
65  !$omp end atomic
66  !$omp atomic hint(0),update relaxed capture  ! { dg-error "multiple atomic clauses" }
67  i = i + 1
68  v = i
69  !$omp end atomic
70end
71