summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/intrinsic_char_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/intrinsic_char_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_char_1.f9017
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_char_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_char_1.f90
new file mode 100644
index 000000000..845493cb6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_char_1.f90
@@ -0,0 +1,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