coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / char_pointer_assign_6.f90
blobcd90bfc06e343d6b612ac6844730a4cab020fd9f
1 ! { dg-do compile }
2 ! PR 31821
3 program main
4 character (len=4), pointer:: s1
5 character (len=20), pointer :: p1
6 character (len=4) :: c
7 s1 = 'abcd'
8 p1 => s1(2:3) ! { dg-error "Unequal character lengths \\(20/2\\)" }
9 p1 => c(1:) ! { dg-error "Unequal character lengths \\(20/4\\)" }
10 p1 => c(:4) ! { dg-error "Unequal character lengths \\(20/4\\)" }
11 end