Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/pointer_component_type_1.f90 @ 128:fe568345ddd5
fix CbC-example
author | mir3636 |
---|---|
date | Wed, 11 Apr 2018 19:32:28 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do compile } ! This checks the fix for PR20889 in wrong pointer types in derived ! type constructors would either give no message or would segfault. ! ! Contributed by Joost VandVondele <jv244@cam.ac.uk> !============== TYPE TEST REAL, POINTER :: A END TYPE TYPE TEST1 REAL :: A END TYPE INTEGER, POINTER :: IP real, POINTER :: RP TYPE(TEST) :: DD TYPE(TEST1) :: EE ! Next line is the original => gave no warning/error. DD=TEST(NULL(IP)) ! { dg-error "INTEGER but should be REAL" } ! Would segfault here. DD=TEST(IP) ! { dg-error "INTEGER but should be REAL" } ! Check right target type is OK. DD=TEST(NULL(RP)) ! Check non-pointer is OK. EE= TEST1(1) ! Test attempted conversion from character to real. EE= TEST1("e") ! { dg-error "convert CHARACTER" } END