[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / widechar_8.f90
blobe61129416cfacc2b23c92ca85a76a37ee2e5afd3
1 ! { dg-do run }
2 ! { dg-options "-fbackslash" }
4 ! PR fortran/37025
6 ! Check whether transferring to character(kind=4) and transferring back works
8 implicit none
9 character(len=4,kind=4) :: str
10 integer(4) :: buffer(4) = [int(z'039f'),int(z'03cd'),int(z'03c7'), &
11 int(z'30b8') ], &
12 buffer2(4)
14 open(6,encoding="UTF-8")
15 str = transfer(buffer, str)
16 !print *, str
17 !print *, 4_'\u039f\u03cd\u03c7\u30b8'
18 if (str /= 4_'\u039f\u03cd\u03c7\u30b8') call abort()
19 str = transfer([int(z'039f'),int(z'03cd'),int(z'03c7'), &
20 int(z'30b8') ], str)
21 if (str /= 4_'\u039f\u03cd\u03c7\u30b8') call abort()
23 buffer2 = transfer(4_'\u039f\u03cd\u03c7\u30b8', buffer2, 4)
24 !print *, buffer
25 !print *, buffer2
26 buffer2 = transfer(str, buffer2, 4)
27 if (any(buffer2 /= buffer)) call abort()
28 end