2 ! { dg-options "-std=legacy" }
4 ! This tests the patch for PR26787 in which it was found that setting
5 ! the result of one module procedure from within another produced an
6 ! ICE rather than an error.
8 ! This is an "elaborated" version of the original testcase from
9 ! Joshua Cogliati <jjcogliati-r1@yahoo.com>
12 integer ext1
, ext2
, arg
18 ext1
= arg
* arg
! OK - host associated.
25 integer function foo ()
26 foo
= 10 ! OK - function result
31 foo
= 20 ! OK - host associated.
34 subroutine bar() ! This was the original bug.
35 foo
= 10 ! { dg-error "is not a variable" }
37 integer function oh_no ()
39 foo
= 5 ! { dg-error "is not a variable" }
46 integer function foo_er ()
47 foo_er
= 10 ! OK - function result
61 stmt_fcn (w
) = sin (w
)
63 x
= 10 ! { dg-error "is not a variable" }
64 y
= 20 ! { dg-error "is not a variable" }
65 foo_er
= 8 ! { dg-error "is not a variable" }
66 ext1
= 99 ! { dg-error "is not a variable" }
67 ext2
= 99 ! { dg-error "is not a variable" }
68 stmt_fcn
= 1.0 ! { dg-error "is not a variable" }
73 y
= i
! { dg-error "is not a variable" }
77 y
= 2 ! OK - function result
80 ! { dg-final { cleanup-modules "simple simpler" } }