Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / OpenMP / declare-target05.f90
blob2334a8506b7e4be3b68ad18de1717bbbc2b3da35
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 5.1
3 ! Check OpenMP construct validity for the following directives:
4 ! 2.14.7 Declare Target Directive
6 module mod0
7 integer :: mi
9 contains
10 subroutine subm()
11 integer, save :: mmi
13 !ERROR: The DECLARE TARGET directive and the common block or variable in it must appear in the same declaration section of a scoping unit
14 !$omp declare target (mi)
15 mi = 1
16 contains
17 subroutine subsubm()
18 !ERROR: The DECLARE TARGET directive and the common block or variable in it must appear in the same declaration section of a scoping unit
19 !$omp declare target (mmi)
20 end
21 end
22 end
24 module mod1
25 integer :: mod_i
26 end
28 program main
29 use mod1
30 integer, save :: i
31 integer :: j
33 !ERROR: The DECLARE TARGET directive and the common block or variable in it must appear in the same declaration section of a scoping unit
34 !$omp declare target (mod_i)
36 contains
37 subroutine sub()
38 !ERROR: The DECLARE TARGET directive and the common block or variable in it must appear in the same declaration section of a scoping unit
39 !ERROR: The DECLARE TARGET directive and the common block or variable in it must appear in the same declaration section of a scoping unit
40 !$omp declare target (i, j)
41 i = 1
42 j = 1
43 end
44 end