+! { dg-do run }\r
+! PR35937, in which letting the length of 'c' to kind = 8 would\r
+! screw up the interface and would cause an ICE. Note that this is\r
+! actually the example of comment #4.\r
+!\r
+! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>\r
+!\r
+program main\r
+ implicit none\r
+ if (f5 ('1') .ne. "a") call abort\r
+ if (len (f5 ('1')) .ne. 1) call abort\r
+ if (f5 ('4') .ne. "abcd") call abort\r
+ if (len (f5 ('4')) .ne. 4) call abort\r
+contains\r
+ function f5 (c)\r
+ character(len=1_8) :: c\r
+ character(len=scan('123456789', c)) :: f5\r
+ integer :: i\r
+ do i = 1, len (f5)\r
+ f5(i:i) = char (i+96)\r
+ end do\r
+ end function f5\r
+end program main\r