This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testsuit]Add complex test in MATMUL.
- From: Feng Wang <wf_cs at yahoo dot com>
- To: fortran <fortran at gcc dot gnu dot org>, patch <gcc-patches at gcc dot gnu dot org>
- Cc: Paul Brook <paul at codesourcery dot com>
- Date: Mon, 5 Jan 2004 11:17:45 +0800 (CST)
- Subject: [testsuit]Add complex test in MATMUL.
Hi, all
This is the patch for intrinsic_matmul.f90. I find the complex type letter
has been corrected in fortran FE. Paul, sorry for the assign patch included the
complex patch. I don't know if it makes sense now. But this is the fortran
Changelog entry:
2004-01-05 Feng Wang <fengwang@nudt.edu.cn>
* intrinsic.c (gfc_type_letter): Change BT_CHARACTER's type letter
to 's' and BT_COMPLEX's to 'c'.
The testsuit Changelog entry:
2004-01-05 Feng Wang <fengwang@nudt.edu.cn>
* gfortran.fortran-torture/excute/intrinsic_matmul.f90:
Add complex test.
Thanks for Paul's hard working.
r~
Feng Wang
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com Index: intrinsic_matmul.f90
===================================================================
RCS file: /home/cvs/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_matmul.f90,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 intrinsic_matmul.f90
*** intrinsic_matmul.f90 3 Dec 2003 22:07:05 -0000 1.1.1.1
--- intrinsic_matmul.f90 16 Dec 2003 17:56:00 -0000
*************** program intrinsic_matmul
*** 7,15 ****
--- 7,20 ----
integer, dimension(3) :: y
integer, dimension(2, 2) :: r
integer, dimension(3) :: v
+ complex, dimension(3, 2) :: c
+ complex, dimension(2, 2) :: z
a = reshape((/1, 2, 2, 3, 3, 4/), (/2, 3/))
b = reshape((/1, 2, 3, 3, 4, 5/), (/3, 2/))
+ c = reshape((/(1.0, 2.0), (2.0, 3.0), (3.0, 4.0), (4.0, 5.0), (5.0, 6.0), &
+ (6.0, 7.0)/), (/3,2/))
+
x = (/1, 2/)
y = (/1, 2, 3/)
*************** program intrinsic_matmul
*** 21,24 ****
--- 26,33 ----
v(1:2) = matmul(a, y)
if (any(v(1:2) .ne. (/14, 20/))) call abort
+
+ z = matmul(a, c)
+ if (any(z .ne. reshape((/(14.0, 20.0), (20.0, 29.0), (32.0, 38.0),&
+ (47.0, 56.0)/), (/2, 2/)))) call abort
end program