public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Nils-Christian Kempke <nckempke@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/fortran/testsuite: add complex from integers test Date: Mon, 11 Apr 2022 12:09:19 +0000 (GMT) [thread overview] Message-ID: <20220411120919.CA9583851475@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=27e8f72f351042e464aa41fa9b39c16f1cd1f965 commit 27e8f72f351042e464aa41fa9b39c16f1cd1f965 Author: Nils-Christian Kempke <nils-christian.kempke@intel.com> Date: Mon Apr 11 14:06:56 2022 +0200 gdb/fortran/testsuite: add complex from integers test 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.fortran/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" " = \\(321,-22\\)" gdb_test "print dc" " = \\(321,-22\\)" gdb_test "print c16" " = \\(-874,19\\)" +gdb_test "print ci" " = \\(-4,12\\)" gdb_test "whatis c" "type = $complex4" gdb_test "print \$_creal (c)" " = 1000" @@ -70,3 +71,8 @@ with_test_prefix "c16" { gdb_test "whatis \$" " = real\\*16" } +gdb_test "whatis ci" "type = $complex4" +gdb_test "print \$_creal (ci)" " = -4" +with_test_prefix "ci" { + gdb_test "whatis \$" " = real\\*4" +} diff --git a/gdb/testsuite/gdb.fortran/complex.f90 b/gdb/testsuite/gdb.fortran/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 - complex c + complex c, ci complex(kind=4) c4 complex(kind=8) c8 double complex dc @@ -30,15 +31,19 @@ program test_complex r8b = -22 r16a = -874 r16b = 19 + ia = -4 + ib = 12 c = cmplx(r4a,r4b) c4 = cmplx(r4a,r4b) c8 = cmplx(r8a, r8b) dc = cmplx(r8a, r8b) c16 = cmplx(r16a, r16b) + ci = cmplx(ia, ib) print *, c, c4, c8, dc, c16 ! stop print *, r4a, r4b print *, r8a, r8b print *, r16a, r16b + print *, ia, ib end program test_complex
reply other threads:[~2022-04-11 12:09 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220411120919.CA9583851475@sourceware.org \ --to=nckempke@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).