URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [common.f90] - Rev 695
Compare with Previous | Blame | View Log
! Program to test COMMON and EQUIVALENCE.program commonreal (kind=8) a(8)real (kind=8) b(5), c(5)common /com1/b,cequivalence (a(1), b(2))b = 100c = 200call common_passcall common_par (a, b,c)call global_equivcall local_equivend! Use common block to pass valuessubroutine common_passreal (kind=8) a(8)real (kind=8) b(5), c(5)common /com1/b,cequivalence (a(1), b(2))if (any (a .ne. (/100,100,100,100,200,200,200,200/))) call abortend subroutine! Common variables as argumentsubroutine common_par (a, b, c)real (kind=8) a(8), b(5), c(5)if (any (a .ne. (/100,100,100,100,200,200,200,200/))) call abortif (any (b .ne. (/100,100,100,100,100/))) call abortif (any (c .ne. (/200,200,200,200,200/))) call abortend subroutine! Global equivalencesubroutine global_equivreal (kind=8) a(8), b(5), c(5), x(8), y(4), z(4)common /com2/b, c, y, zequivalence (a(1), b(2))equivalence (x(4), y(1))b = 100c = 200y = 300z = 400if (any (a .ne. (/100,100,100,100,200,200,200,200/))) call abortif (any (x .ne. (/200,200,200,300,300,300,300,400/))) call abortend! Local equivalencesubroutine local_equivreal (kind=8) a(8), b(10)equivalence (a(1), b(3))b(1:5) = 100b(6:10) = 200if (any (a .ne. (/100,100,100,200,200,200,200,200/))) call abortend subroutine
