[test] Remove redundant -march= in llc -mtriple=
[llvm-project.git] / flang / test / Semantics / OpenACC / acc-canonicalization-validity.f90
blobced7dd46803eef883c8b0cbb962c4c950aad2b5c
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenacc
3 ! Check OpenACC canonalization validity for the construct defined below:
4 ! 2.9 Loop
5 ! 2.11 Parallel Loop
6 ! 2.11 Kernels Loop
7 ! 2.11 Serial Loop
9 program openacc_clause_validity
11 implicit none
13 integer :: i, j
14 integer :: N = 256
15 real(8) :: a(256)
16 real(8) :: aa(256, 256)
18 i = 0
20 !ERROR: DO loop after the LOOP directive must have loop control
21 !$acc loop
23 end do
25 !$acc parallel loop
26 do i = 1, N
27 a(i) = 3.14
28 end do
30 !$acc kernels loop
31 do i = 1, N
32 a(i) = 3.14
33 end do
35 !$acc serial loop
36 do i = 1, N
37 a(i) = 3.14
38 end do
40 !$acc parallel loop
41 do i = 1, N
42 a(i) = 3.14
43 end do
44 !$acc end parallel loop
46 !$acc kernels loop
47 do i = 1, N
48 a(i) = 3.14
49 end do
50 !$acc end kernels loop
52 !$acc serial loop
53 do i = 1, N
54 a(i) = 3.14
55 end do
56 !$acc end serial loop
58 !ERROR: DO loop after the PARALLEL LOOP directive must have loop control
59 !$acc parallel loop
61 end do
63 !ERROR: DO loop after the KERNELS LOOP directive must have loop control
64 !$acc kernels loop
66 end do
68 !ERROR: DO loop after the SERIAL LOOP directive must have loop control
69 !$acc serial loop
71 end do
73 !$acc parallel
74 !ERROR: The loop construct with the TILE clause must be followed by 2 tightly-nested loops
75 !$acc loop tile(2, 2)
76 do i = 1, N
77 a(i) = 3.14
78 end do
79 !$acc end parallel
81 !ERROR: The loop construct with the TILE clause must be followed by 2 tightly-nested loops
82 !$acc parallel loop tile(2, 2)
83 do i = 1, N
84 a(i) = 3.14
85 end do
87 !$acc parallel
88 !ERROR: TILE and COLLAPSE clause may not appear on loop construct associated with DO CONCURRENT
89 !$acc loop collapse(2)
90 do concurrent (i = 1:N, j = 1:N)
91 aa(i, j) = 3.14
92 end do
93 !$acc end parallel
95 !$acc parallel
96 !ERROR: TILE and COLLAPSE clause may not appear on loop construct associated with DO CONCURRENT
97 !$acc loop tile(2, 2)
98 do concurrent (i = 1:N, j = 1:N)
99 aa(i, j) = 3.14
100 end do
101 !$acc end parallel
103 end program openacc_clause_validity