|
| 1 | +! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=51 |
| 2 | + |
| 3 | +subroutine defaultmap_all_none_no_errors |
| 4 | + implicit none |
| 5 | + real :: array(10) |
| 6 | + integer, pointer :: ptr(:) |
| 7 | + real, allocatable :: alloca |
| 8 | + integer :: index |
| 9 | + |
| 10 | + !$omp target defaultmap(none) map(to: index, alloca) map(tofrom: array, ptr) |
| 11 | + do index = 1, 10 |
| 12 | + ptr(index) = array(index) + alloca |
| 13 | + end do |
| 14 | + !$omp end target |
| 15 | +end subroutine defaultmap_all_none_no_errors |
| 16 | + |
| 17 | +subroutine defaultmap_all_none |
| 18 | + implicit none |
| 19 | + real :: array(10) |
| 20 | + integer, pointer :: ptr(:) |
| 21 | + real, allocatable :: alloca |
| 22 | + integer :: index |
| 23 | + !$omp target defaultmap(none) |
| 24 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 25 | + do index = 1, 10 |
| 26 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'ptr' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 27 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 28 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'array' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 29 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 30 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'alloca' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 31 | + ptr(index) = array(index) + alloca |
| 32 | + end do |
| 33 | + !$omp end target |
| 34 | +end subroutine defaultmap_all_none |
| 35 | + |
| 36 | +subroutine defaultmap_scalar_none |
| 37 | + implicit none |
| 38 | + real :: array(10) |
| 39 | + integer, pointer :: ptr(:) |
| 40 | + real, allocatable :: alloca |
| 41 | + integer :: index |
| 42 | + |
| 43 | + !$omp target defaultmap(none: scalar) |
| 44 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 45 | + do index = 1, 10 |
| 46 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 47 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 48 | + ptr(index) = array(index) + alloca |
| 49 | + end do |
| 50 | + !$omp end target |
| 51 | +end subroutine defaultmap_scalar_none |
| 52 | + |
| 53 | +subroutine defaultmap_pointer_none |
| 54 | + implicit none |
| 55 | + real :: array(10) |
| 56 | + integer, pointer :: ptr(:) |
| 57 | + real, allocatable :: alloca |
| 58 | + integer :: index |
| 59 | + |
| 60 | + !$omp target defaultmap(none: pointer) |
| 61 | + do index = 1, 10 |
| 62 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'ptr' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 63 | + ptr(index) = array(index) + alloca |
| 64 | + end do |
| 65 | + !$omp end target |
| 66 | +end subroutine defaultmap_pointer_none |
| 67 | + |
| 68 | +subroutine defaultmap_allocatable_none |
| 69 | + implicit none |
| 70 | + real :: array(10) |
| 71 | + integer, pointer :: ptr(:) |
| 72 | + real, allocatable :: alloca |
| 73 | + integer :: index |
| 74 | + |
| 75 | + !$omp target defaultmap(none: allocatable) |
| 76 | + do index = 1, 10 |
| 77 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'alloca' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 78 | + ptr(index) = array(index) + alloca |
| 79 | + end do |
| 80 | + !$omp end target |
| 81 | +end subroutine defaultmap_allocatable_none |
| 82 | + |
| 83 | +subroutine defaultmap_aggregate_none |
| 84 | + implicit none |
| 85 | + real :: array(10) |
| 86 | + integer, pointer :: ptr(:) |
| 87 | + real, allocatable :: alloca |
| 88 | + integer :: index |
| 89 | + |
| 90 | + !$omp target defaultmap(none: aggregate) |
| 91 | + do index = 1, 10 |
| 92 | +!ERROR: The DEFAULTMAP(NONE) clause requires that 'array' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause |
| 93 | + ptr(index) = array(index) + alloca |
| 94 | + end do |
| 95 | + !$omp end target |
| 96 | +end subroutine defaultmap_aggregate_none |
0 commit comments