[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-nested-target.f90
blobea061bddfe80a5a291416043d677a67dd9be4bb6
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
3 ! OpenMP Version 5.0
4 ! Check OpenMP construct validity for the following directives:
5 ! 2.12.5 Target Construct
7 program main
8 integer :: i, j, N = 10
9 real :: a, arrayA(512), arrayB(512), ai(10)
10 real, allocatable :: B(:)
12 !$omp target
13 !WARNING: If TARGET UPDATE directive is nested inside TARGET region, the behaviour is unspecified
14 !$omp target update from(arrayA) to(arrayB)
15 do i = 1, 512
16 arrayA(i) = arrayB(i)
17 end do
18 !$omp end target
20 !$omp parallel
21 !$omp target
22 !$omp parallel
23 !WARNING: If TARGET UPDATE directive is nested inside TARGET region, the behaviour is unspecified
24 !$omp target update from(arrayA) to(arrayB)
25 do i = 1, 512
26 arrayA(i) = arrayB(i)
27 end do
28 !$omp end parallel
29 !$omp end target
30 !$omp end parallel
32 !$omp target
33 !WARNING: If TARGET DATA directive is nested inside TARGET region, the behaviour is unspecified
34 !$omp target data map(to: a)
35 do i = 1, N
36 a = 3.14
37 end do
38 !$omp end target data
39 !$omp end target
41 allocate(B(N))
42 !$omp target
43 !WARNING: If TARGET ENTER DATA directive is nested inside TARGET region, the behaviour is unspecified
44 !$omp target enter data map(alloc:B)
45 !$omp end target
47 !$omp target
48 !WARNING: If TARGET EXIT DATA directive is nested inside TARGET region, the behaviour is unspecified
49 !$omp target exit data map(delete:B)
50 !$omp end target
51 deallocate(B)
53 end program main