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