[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / OpenMP / omp-atomic02.f90
blob336949ada33247dab62a675eae8108d613c78c38
1 ! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
3 ! OpenMP Atomic construct
4 ! section 2.17.7
5 ! operator is one of +, *, -, /, .AND., .OR., .EQV., or .NEQV
7 program OmpAtomic
8 use omp_lib
9 CHARACTER c*3, d*3
10 LOGICAL l, m, n
12 a = 1
13 b = 2
14 c = 'foo'
15 d = 'bar'
16 m = .TRUE.
17 n = .FALSE.
18 !$omp parallel num_threads(4)
20 !$omp atomic
21 a = a + (4*2)
22 !$omp atomic
23 a = a*(b + 1)
24 !$omp atomic
25 a = a - 3
26 !$omp atomic
27 a = a/(b + 1)
28 !$omp atomic
29 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
30 a = a**4
31 !$omp atomic
32 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
33 c = c//d
34 !$omp atomic
35 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
36 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
37 l = a .LT. b
38 !$omp atomic
39 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
40 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
41 l = a .LE. b
42 !$omp atomic
43 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
44 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
45 l = a .EQ. b
46 !$omp atomic
47 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
48 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
49 l = a .NE. b
50 !$omp atomic
51 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
52 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
53 l = a .GE. b
54 !$omp atomic
55 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
56 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
57 l = a .GT. b
58 !$omp atomic
59 m = m .AND. n
60 !$omp atomic
61 m = m .OR. n
62 !$omp atomic
63 m = m .EQV. n
64 !$omp atomic
65 m = m .NEQV. n
66 !$omp atomic update
67 a = a + (4*2)
68 !$omp atomic update
69 a = a*(b + 1)
70 !$omp atomic update
71 a = a - 3
72 !$omp atomic update
73 a = a/(b + 1)
74 !$omp atomic update
75 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
76 a = a**4
77 !$omp atomic update
78 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
79 c = c//d
80 !$omp atomic update
81 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
82 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
83 l = a .LT. b
84 !$omp atomic update
85 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
86 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
87 l = a .LE. b
88 !$omp atomic update
89 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
90 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
91 l = a .EQ. b
92 !$omp atomic update
93 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
94 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
95 l = a .GE. b
96 !$omp atomic update
97 !ERROR: Atomic update variable 'l' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
98 !ERROR: Invalid operator in OpenMP ATOMIC (UPDATE) statement
99 l = a .GT. b
100 !$omp atomic update
101 m = m .AND. n
102 !$omp atomic update
103 m = m .OR. n
104 !$omp atomic update
105 m = m .EQV. n
106 !$omp atomic update
107 m = m .NEQV. n
108 !$omp end parallel
109 end program OmpAtomic