aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/common_init_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/common_init_1.f90')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/common_init_1.f9024
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/common_init_1.f90 b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/common_init_1.f90
new file mode 100644
index 000000000..9e5aec0f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.fortran-torture/execute/common_init_1.f90
@@ -0,0 +1,24 @@
+! Program to test initialization of common blocks.
+subroutine test()
+ character(len=15) :: c
+ integer d, e
+ real f
+ common /block2/ c
+ common /block/ d, e, f
+
+ if ((d .ne. 42) .or. (e .ne. 43) .or. (f .ne. 2.0)) call abort ()
+ if (c .ne. "Hello World ") call abort ()
+end subroutine
+
+program prog
+ integer a(2)
+ real b
+ character(len=15) :: s
+ common /block/ a, b
+ common /block2/ s
+ data b, a/2.0, 42, 43/
+ data s /"Hello World"/
+
+ call test ()
+end program
+