|
| 1 | +subroutine f |
| 2 | + implicit none |
| 3 | + type t |
| 4 | + integer :: i |
| 5 | + end type t |
| 6 | + integer, target :: scalar |
| 7 | + integer, target :: array(5) |
| 8 | + integer, pointer :: ptr1, ptr2(:) |
| 9 | + integer, allocatable :: alloc1, alloc2(:) |
| 10 | + type(t) :: agg1, agg2(2) |
| 11 | + |
| 12 | + scalar = 1 |
| 13 | + array = [1,2,3,4,5] |
| 14 | + ptr1 => scalar |
| 15 | + ptr2 => array |
| 16 | + alloc1 = 5 |
| 17 | + alloc2 = [1,2] |
| 18 | + agg1%i = 1 |
| 19 | + agg2(:)%i = [1,2] |
| 20 | + |
| 21 | + !$omp target defaultmap(firstprivate ) defaultmap(firstprivate : aggregate) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP with unspecified category" } |
| 22 | + block |
| 23 | + scalar = 1; |
| 24 | + array(1) = 2; |
| 25 | + if (associated(ptr1)) & |
| 26 | + agg1%i = 3; |
| 27 | + if (associated(ptr2)) & |
| 28 | + agg2(1)%i = 3; |
| 29 | + if (allocated(alloc1)) & |
| 30 | + alloc2(1) = 0 |
| 31 | + end block |
| 32 | + |
| 33 | + !$omp target defaultmap(firstprivate : all ) defaultmap(alloc : pointer) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP for category ALL" } |
| 34 | + block |
| 35 | + scalar = 1; |
| 36 | + array(1) = 2; |
| 37 | + if (associated(ptr1)) & |
| 38 | + agg1%i = 3; |
| 39 | + if (associated(ptr2)) & |
| 40 | + agg2(1)%i = 3; |
| 41 | + if (allocated(alloc1)) & |
| 42 | + alloc2(1) = 0 |
| 43 | + end block |
| 44 | + |
| 45 | + !$omp target defaultmap(firstprivate : aggregate) defaultmap(firstprivate ) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP for category AGGREGATE" } |
| 46 | + block |
| 47 | + scalar = 1; |
| 48 | + array(1) = 2; |
| 49 | + if (associated(ptr1)) & |
| 50 | + agg1%i = 3; |
| 51 | + if (associated(ptr2)) & |
| 52 | + agg2(1)%i = 3; |
| 53 | + if (allocated(alloc1)) & |
| 54 | + alloc2(1) = 0 |
| 55 | + end block |
| 56 | + |
| 57 | + !$omp target defaultmap(alloc : pointer) defaultmap(firstprivate : all ) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP for category POINTER" } |
| 58 | + block |
| 59 | + scalar = 1; |
| 60 | + array(1) = 2; |
| 61 | + if (associated(ptr1)) & |
| 62 | + agg1%i = 3; |
| 63 | + if (associated(ptr2)) & |
| 64 | + agg2(1)%i = 3; |
| 65 | + if (allocated(alloc1)) & |
| 66 | + alloc2(1) = 0 |
| 67 | + end block |
| 68 | + |
| 69 | + !$omp target defaultmap(firstprivate :all ) defaultmap(firstprivate : all) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP for category ALL" } |
| 70 | + block |
| 71 | + scalar = 1; |
| 72 | + array(1) = 2; |
| 73 | + if (associated(ptr1)) & |
| 74 | + agg1%i = 3; |
| 75 | + if (associated(ptr2)) & |
| 76 | + agg2(1)%i = 3; |
| 77 | + if (allocated(alloc1)) & |
| 78 | + alloc2(1) = 0 |
| 79 | + end block |
| 80 | + |
| 81 | + !$omp target defaultmap(firstprivate ) defaultmap(firstprivate) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP with unspecified category" } |
| 82 | + block |
| 83 | + scalar = 1; |
| 84 | + array(1) = 2; |
| 85 | + if (associated(ptr1)) & |
| 86 | + agg1%i = 3; |
| 87 | + if (associated(ptr2)) & |
| 88 | + agg2(1)%i = 3; |
| 89 | + if (allocated(alloc1)) & |
| 90 | + alloc2(1) = 0 |
| 91 | + end block |
| 92 | + |
| 93 | + !$omp target defaultmap(firstprivate ) defaultmap(firstprivate : all) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP with unspecified category" } |
| 94 | + block |
| 95 | + scalar = 1; |
| 96 | + array(1) = 2; |
| 97 | + if (associated(ptr1)) & |
| 98 | + agg1%i = 3; |
| 99 | + if (associated(ptr2)) & |
| 100 | + agg2(1)%i = 3; |
| 101 | + if (allocated(alloc1)) & |
| 102 | + alloc2(1) = 0 |
| 103 | + end block |
| 104 | + |
| 105 | + !$omp target defaultmap(firstprivate : all) defaultmap(firstprivate) ! { dg-error "DEFAULTMAP at .1. but prior DEFAULTMAP for category ALL" } |
| 106 | + block |
| 107 | + scalar = 1; |
| 108 | + array(1) = 2; |
| 109 | + if (associated(ptr1)) & |
| 110 | + agg1%i = 3; |
| 111 | + if (associated(ptr2)) & |
| 112 | + agg2(1)%i = 3; |
| 113 | + if (allocated(alloc1)) & |
| 114 | + alloc2(1) = 0 |
| 115 | + end block |
| 116 | +end |
0 commit comments