summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/intrinsic_char_1.f90
blob: 845493cb649cd5d052954dc8516d2bed41feec86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do run }
! Tests the fix for PR35932, in which the KIND argument of CHAR
! was not converted and this screwed up the scalarizer.
!
! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
!
program FA0005

  CHARACTER(1) CDA1(10)
  character(10) CDA10
  INTEGER :: IDA(10) = [(i, i = 97,106)]

  CDA1 = CHAR (  IDA, KIND("A" ))     !failed
  if (transfer (CDA1, CDA10) /= "abcdefghij") call abort ()
  CDA1 = CHAR (  IDA  )               !worked
  if (transfer (CDA1, CDA10) /= "abcdefghij") call abort ()
END