1! { dg-additional-options "-fdump-tree-gimple" }
2! { dg-final { scan-tree-dump "foo \\(4\\);\[\n\r]*  __atomic_thread_fence \\(4\\);\[\n\r]*  foo \\(4\\);" "gimple" } }
3! { dg-final { scan-tree-dump "foo \\(3\\);\[\n\r]*  __atomic_thread_fence \\(3\\);\[\n\r]*  foo \\(3\\);" "gimple" } }
4! { dg-final { scan-tree-dump "foo \\(2\\);\[\n\r]*  __atomic_thread_fence \\(2\\);\[\n\r]*  foo \\(2\\);" "gimple" } }
5! { dg-final { scan-tree-dump "foo \\(5\\);\[\n\r]*  __sync_synchronize \\(\\);\[\n\r]*  foo \\(5\\);" "gimple" } }
6
7module m
8  interface
9    subroutine foo(x)
10      integer, value :: x
11    end
12  end interface
13end module m
14
15subroutine f1
16  use m
17  call foo (4)
18  !$omp flush acq_rel
19  call foo (4)
20end
21
22subroutine f2
23  use m
24  call foo (3)
25  !$omp flush release
26  call foo (3)
27end
28
29subroutine f3
30  use m
31  call foo (2)
32  !$omp flush acquire
33  call foo (2)
34end
35
36subroutine f4
37  use m
38  call foo (5)
39  !$omp flush
40  call foo (5)
41end
42