1! { dg-additional-options "-ffree-line-length-none" }
2module m
3!$omp error			! { dg-error ".OMP ERROR encountered at .1." }
4!$omp error at(compilation)	! { dg-error ".OMP ERROR encountered at .1." }
5!$omp error severity(fatal)	! { dg-error ".OMP ERROR encountered at .1." }
6!$omp error message("my msg")	! { dg-error ".OMP ERROR encountered at .1.: my msg" }
7!$omp error severity(warning)message("another message")at(compilation)	! { dg-warning ".OMP ERROR encountered at .1.: another message" }
8
9type S
10  !$omp error			! { dg-error ".OMP ERROR encountered at .1." }
11  !$omp error at(compilation)	! { dg-error ".OMP ERROR encountered at .1." }
12  !$omp error severity(fatal)	! { dg-error ".OMP ERROR encountered at .1." }
13  !$omp error message("42")	! { dg-error ".OMP ERROR encountered at .1.: 42" }
14  !$omp error severity(warning), message("foo"), at(compilation)	! { dg-warning ".OMP ERROR encountered at .1.: foo" }
15  integer s
16end type S
17end module m
18
19integer function foo (i, x)
20  integer :: i
21  logical :: x
22  !$omp error			! { dg-error ".OMP ERROR encountered at .1." }
23  !$omp error at(compilation)	! { dg-error ".OMP ERROR encountered at .1." }
24  !$omp error severity(fatal)	! { dg-error ".OMP ERROR encountered at .1." }
25  !$omp error message("42 / 1")	! { dg-error ".OMP ERROR encountered at .1.: 42 / 1" }
26  !$omp error severity(warning) message("bar") at(compilation)	! { dg-warning ".OMP ERROR encountered at .1.: bar" }
27  if (x) then
28    !$omp error			! { dg-error ".OMP ERROR encountered at .1." }
29    i = i + 1
30  end if
31  if (x) then
32    ;
33  else
34    !$omp error at(compilation)	! { dg-error ".OMP ERROR encountered at .1." }
35    i = i + 1
36  end if
37  select case (.false.)
38    !$omp error severity(fatal)	! { dg-error ".OMP ERROR encountered at .1." }
39    case default
40      !
41  end select
42  do while (.false.)
43    !$omp error message("42 - 1")	! { dg-error ".OMP ERROR encountered at .1.: 42 - 1" }
44    i = i + 1
45  end do
46  lab:
47  !$omp error severity(warning) message("bar") at(compilation)	! { dg-warning ".OMP ERROR encountered at .1.: bar" }
48    i++;
49  foo = i
50  return
51end
52