! Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
!     http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
!
!
! Tests F2003 allocatable semantics with CHAR intrinsic.
 
program p
  logical rslt(4), expect(4)  
  character(1), allocatable :: c1, c2
  integer :: i = 77 
  
  rslt = .false.
  expect = .true.
  c1 = CHAR(i)
  c2 = ACHAR(i)
  
  rslt(1) = allocated(c1)
  rslt(2) = allocated(c2)
  if (rslt(1)) then
    rslt(3) = c1 .eq. 'M'
  endif
  if (rslt(2)) then
    rslt(4) = c2 .eq. 'M'
  endif
  
  call check(rslt, expect, 4)
end program p
