57 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=504use omp_lib5!2.11.4 Allocate Clause6!For any list item that is specified in the allocate7!clause on a directive, a data-sharing attribute clause8!that may create a private copy of that list item must be9!specified on the same directive.10 11 integer :: N = 212 13 !ERROR: The ALLOCATE clause requires that 'x' must be listed in a private data-sharing attribute clause on the same directive14 !$omp parallel allocate(omp_default_mem_space : x)15 do i = 1, N16 x = 217 enddo18 !$omp end parallel19 20 !ERROR: The ALLOCATE clause requires that 'y' must be listed in a private data-sharing attribute clause on the same directive21 !$omp parallel allocate(omp_default_mem_space : y) firstprivate(x)22 do i = 1, N23 x = 224 enddo25 !$omp end parallel26 27 !ERROR: The ALLOCATE clause requires that 'x' must be listed in a private data-sharing attribute clause on the same directive28 !ERROR: The ALLOCATE clause requires that 'x' must be listed in a private data-sharing attribute clause on the same directive29 !$omp parallel allocate(omp_default_mem_space : x) allocate(omp_default_mem_space : x)30 do i = 1, N31 x = 232 enddo33 !$omp end parallel34 35 !ERROR: The ALLOCATE clause requires that 'f' must be listed in a private data-sharing attribute clause on the same directive36 !$omp parallel allocate(omp_default_mem_space : f) shared(f)37 do i = 1, N38 x = 239 enddo40 !$omp end parallel41 42 !ERROR: The ALLOCATE clause requires that 'q' must be listed in a private data-sharing attribute clause on the same directive43 !$omp parallel private(t) allocate(omp_default_mem_space : z, t, q, r) firstprivate(z, r)44 do i = 1, N45 x = 246 enddo47 !$omp end parallel48 49 !ERROR: The ALLOCATE clause requires that 'b' must be listed in a private data-sharing attribute clause on the same directive50 !ERROR: The ALLOCATE clause requires that 'c' must be listed in a private data-sharing attribute clause on the same directive51 !$omp parallel allocate(omp_default_mem_space : a, b, c, d) firstprivate(a, d)52 do i = 1, N53 x = 254 enddo55 !$omp end parallel56end57