2 ! This tests the patch for PR26787 in which it was found that setting
3 ! the result of one module procedure from within another produced an
4 ! ICE rather than an error.
6 ! This is an "elaborated" version of the original testcase from
7 ! Joshua Cogliati <jjcogliati-r1@yahoo.com>
10 integer ext1
, ext2
, arg
16 ext1
= arg
* arg
! OK - host associated.
23 integer function foo ()
24 foo
= 10 ! OK - function result
29 foo
= 20 ! OK - host associated.
32 subroutine bar() ! This was the original bug.
33 foo
= 10 ! { dg-error "is not a VALUE" }
35 integer function oh_no ()
37 foo
= 5 ! { dg-error "is not a VALUE" }
44 integer function foo_er ()
45 foo_er
= 10 ! OK - function result
59 stmt_fcn (w
) = sin (w
)
61 x
= 10 ! { dg-error "Expected VARIABLE" }
62 y
= 20 ! { dg-error "is not a VALUE" }
63 foo_er
= 8 ! { dg-error "is not a VALUE" }
64 ext1
= 99 ! { dg-error "is not a VALUE" }
65 ext2
= 99 ! { dg-error "is not a VALUE" }
66 stmt_fcn
= 1.0 ! { dg-error "Expected VARIABLE" }
71 y
= i
! { dg-error "is not a VALUE" }
75 y
= 2 ! OK - function result
78 ! { dg-final { cleanup-modules "simple simpler" } }