Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/inquiry_type_ref_6.f90 @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 ! { dg-do run } | |
2 ! { dg-options "-fcheck=all" } | |
3 ! | |
4 ! Test the fix for PR93581 and the implementation of note 9.7 of F2018. | |
5 ! The latter requires that the result of the LEN inquiry be a scalar | |
6 ! even for array expressions. | |
7 ! | |
8 ! Contributed by Gerhard Steinmetz <gscfq@t-online.de> | |
9 ! | |
10 program p | |
11 complex, target :: z(2) = [(1.0, 2.0),(3.0, 4.0)] | |
12 character(:), allocatable, target :: c(:) | |
13 real, pointer :: r(:) | |
14 character(:), pointer :: s(:) | |
15 | |
16 r => z%re | |
17 if (any (r .ne. real (z))) stop 1 | |
18 r => z%im | |
19 if (any (r .ne. imag (z))) stop 2 | |
20 | |
21 allocate (c, source = ['abc','def']) | |
22 s(-2:-1) => c(1:2) | |
23 if (s%len .ne. len (c)) stop 3 | |
24 end |