From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7876) id CA9583851475; Mon, 11 Apr 2022 12:09:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA9583851475 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nils-Christian Kempke To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/fortran/testsuite: add complex from integers test X-Act-Checkin: binutils-gdb X-Git-Author: Nils-Christian Kempke X-Git-Refname: refs/heads/master X-Git-Oldrev: 891e4190ba705373eec7b374209478215fff5401 X-Git-Newrev: 27e8f72f351042e464aa41fa9b39c16f1cd1f965 Message-Id: <20220411120919.CA9583851475@sourceware.org> Date: Mon, 11 Apr 2022 12:09:19 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2022 12:09:19 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D27e8f72f3510= 42e464aa41fa9b39c16f1cd1f965 commit 27e8f72f351042e464aa41fa9b39c16f1cd1f965 Author: Nils-Christian Kempke Date: Mon Apr 11 14:06:56 2022 +0200 gdb/fortran/testsuite: add complex from integers test =20 When working on the files I noted that there was no actual test for a COMPLEX built from two INTEGERS. I added that now for completion. Diff: --- gdb/testsuite/gdb.fortran/complex.exp | 6 ++++++ gdb/testsuite/gdb.fortran/complex.f90 | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.fortran/complex.exp b/gdb/testsuite/gdb.fort= ran/complex.exp index f4a80fbf783..ca41c812364 100644 --- a/gdb/testsuite/gdb.fortran/complex.exp +++ b/gdb/testsuite/gdb.fortran/complex.exp @@ -41,6 +41,7 @@ gdb_test "print c8" " =3D \\(321,-22\\)" gdb_test "print dc" " =3D \\(321,-22\\)" =20 gdb_test "print c16" " =3D \\(-874,19\\)" +gdb_test "print ci" " =3D \\(-4,12\\)" =20 gdb_test "whatis c" "type =3D $complex4" gdb_test "print \$_creal (c)" " =3D 1000" @@ -70,3 +71,8 @@ with_test_prefix "c16" { gdb_test "whatis \$" " =3D real\\*16" } =20 +gdb_test "whatis ci" "type =3D $complex4" +gdb_test "print \$_creal (ci)" " =3D -4" +with_test_prefix "ci" { + gdb_test "whatis \$" " =3D real\\*4" +} diff --git a/gdb/testsuite/gdb.fortran/complex.f90 b/gdb/testsuite/gdb.fort= ran/complex.f90 index 5c9491df023..cd1acecad54 100644 --- a/gdb/testsuite/gdb.fortran/complex.f90 +++ b/gdb/testsuite/gdb.fortran/complex.f90 @@ -17,8 +17,9 @@ program test_complex real*4 r4a, r4b real*8 r8a, r8b real*16 r16a, r16b + integer ia, ib =20 - complex c + complex c, ci complex(kind=3D4) c4 complex(kind=3D8) c8 double complex dc @@ -30,15 +31,19 @@ program test_complex r8b =3D -22 r16a =3D -874 r16b =3D 19 + ia =3D -4 + ib =3D 12 =20 c =3D cmplx(r4a,r4b) c4 =3D cmplx(r4a,r4b) c8 =3D cmplx(r8a, r8b) dc =3D cmplx(r8a, r8b) c16 =3D cmplx(r16a, r16b) + ci =3D cmplx(ia, ib) =20 print *, c, c4, c8, dc, c16 ! stop print *, r4a, r4b print *, r8a, r8b print *, r16a, r16b + print *, ia, ib end program test_complex