1! { dg-do run } 2 3 integer, allocatable :: a, b(:), c(:,:) 4 logical :: l 5 if (allocated (a) .or. allocated (b) .or. allocated (c)) STOP 1 6 7!$omp parallel private (a, b, c, l) 8 l = .false. 9 if (allocated (a) .or. allocated (b) .or. allocated (c)) STOP 2 10 11!$omp single 12 allocate (a, b(6:9), c(3, 8:9)) 13 a = 4 14 b = 5 15 c = 6 16!$omp end single copyprivate (a, b, c) 17 18 if (.not.allocated (a)) STOP 3 19 if (.not.allocated (b) .or. size (b) /= 4) STOP 4 20 if (lbound (b, 1) /= 6 .or. ubound (b, 1) /= 9) STOP 5 21 if (.not.allocated (c) .or. size (c) /= 6) STOP 6 22 if (size (c, 1) /= 3 .or. size (c, 2) /= 2) STOP 7 23 if (lbound (c, 1) /= 1 .or. ubound (c, 1) /= 3) STOP 8 24 if (lbound (c, 2) /= 8 .or. ubound (c, 2) /= 9) STOP 9 25 if (a /= 4 .or. any (b /= 5) .or. any (c /= 6)) STOP 10 26 27!$omp single 28 deallocate (a, b, c) 29 if (allocated (a) .or. allocated (b) .or. allocated (c)) STOP 11 30 allocate (a, b(0:4), c(3, 2:7)) 31 a = 1 32 b = 2 33 c = 3 34!$omp end single copyprivate (a, b, c) 35 36 if (.not.allocated (a)) STOP 12 37 if (.not.allocated (b) .or. size (b) /= 5) STOP 13 38 if (lbound (b, 1) /= 0 .or. ubound (b, 1) /= 4) STOP 14 39 if (.not.allocated (c) .or. size (c) /= 18) STOP 15 40 if (size (c, 1) /= 3 .or. size (c, 2) /= 6) STOP 16 41 if (lbound (c, 1) /= 1 .or. ubound (c, 1) /= 3) STOP 17 42 if (lbound (c, 2) /= 2 .or. ubound (c, 2) /= 7) STOP 18 43 if (a /= 1 .or. any (b /= 2) .or. any (c /= 3)) STOP 19 44 45!$omp single 46 l = .true. 47 deallocate (a, b, c) 48 if (allocated (a) .or. allocated (b) .or. allocated (c)) STOP 20 49 allocate (a, b(2:6), c(3:5, 3:8)) 50 a = 7 51 b = 8 52 c = 9 53!$omp end single copyprivate (a, b, c) 54 55 if (.not.allocated (a)) STOP 21 56 if (.not.allocated (b) .or. size (b) /= 5) STOP 22 57 if (l) then 58 if (lbound (b, 1) /= 2 .or. ubound (b, 1) /= 6) STOP 23 59 else 60 if (lbound (b, 1) /= 0 .or. ubound (b, 1) /= 4) STOP 24 61 end if 62 if (.not.allocated (c) .or. size (c) /= 18) STOP 25 63 if (size (c, 1) /= 3 .or. size (c, 2) /= 6) STOP 26 64 if (l) then 65 if (lbound (c, 1) /= 3 .or. ubound (c, 1) /= 5) STOP 27 66 if (lbound (c, 2) /= 3 .or. ubound (c, 2) /= 8) STOP 28 67 else 68 if (lbound (c, 1) /= 1 .or. ubound (c, 1) /= 3) STOP 29 69 if (lbound (c, 2) /= 2 .or. ubound (c, 2) /= 7) STOP 30 70 end if 71 if (a /= 7 .or. any (b /= 8) .or. any (c /= 9)) STOP 31 72 73!$omp end parallel 74end 75