From: Yao Qi <yao@codesourcery.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [_Complex test 2/4] _Complex type in varargs.exp
Date: Fri, 20 May 2011 15:22:00 -0000 [thread overview]
Message-ID: <4DD68727.3040502@codesourcery.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1105191525110.13146@digraph.polyomino.org.uk>
[-- Attachment #1: Type: text/plain, Size: 2084 bytes --]
On 05/19/2011 11:27 PM, Joseph S. Myers wrote:
> On Thu, 19 May 2011, Yao Qi wrote:
>
>> Tests in this case also fail on armv7l-unknown-linux-gnueabi and
>> x86_64-unknown-linux-gnu. Shall I have to file yet another two PRs for
>> armv7l-unknown-linux-gnueabi and x86_64-unknown-linux-gnu respectively,
>> and KFAIL them to different PR separately? At least, I didn't see such
>> usage elsewhere in gdb testsuite.
>
> I think the correct division is one PR per target architecture for all
> complex types ABI issues, rather than one PR per test failure. That's the
> only way a target maintainer can sensibly fix their target's problems,
> test that they are fixed, and close the relevant PR; otherwise you have a
> catch-all bug that's open for ever without meaningfully reflecting what
> actually needs to be done to fix the problem.
OK, I opened another two PRs for armv7l-unknown-linux-gnueabi and
x86_64-unknown-linux-gnu. KFAIL to different PRs according to the
target. An internal error on x86_64-linux is not KFAIL'ed, because I
failed to KFAIL it after some experiments for some time.
x86_64-unknown-linux-gnu:
KFAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3,
fc4) (PRMS: gdb/12790)
KFAIL: gdb.base/varargs.exp: print find_max_double_real(4, dc1, dc2,
dc3, dc4) (PRMS: gdb/12790)
FAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1,
ldc2, ldc3, ldc4) (GDB internal error)
armv7l-unknown-linux-gnueabi:
KFAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3,
fc4) (PRMS: gdb/12791)
KFAIL: gdb.base/varargs.exp: print find_max_double_real(4, dc1, dc2,
dc3, dc4) (PRMS: gdb/12791)
KFAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1,
ldc2, ldc3, ldc4) (PRMS: gdb/12791)
i686-pc-linux-gnu:
KFAIL: gdb.base/varargs.exp: print find_max_double_real(4, dc1, dc2,
dc3, dc4) (PRMS: gdb/12776)
KFAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1,
ldc2, ldc3, ldc4) (PRMS: gdb/12776)
If this patch is acceptable, I'll do the similar changes in patch 4/4.
--
Yao (é½å°§)
[-- Attachment #2: 0002-vararg-of-type-_Complex.patch --]
[-- Type: text/x-patch, Size: 4741 bytes --]
From 66ec9759f8595d3f998ed612a1bf6e79be85fc6e Mon Sep 17 00:00:00 2001
From: Yao Qi <yao@codesourcery.com>
Date: Wed, 18 May 2011 15:35:31 +0800
Subject: [PATCH 2/4] vararg of type _Complex
gdb/testsuite/
Test inf-call of varargs of type _Complex.
* gdb.base/varargs.c (find_max_float_real): New.
(find_max_double_real, find_max_long_double_real): New.
* gdb.base/varargs.exp: Call these new added functions.
---
gdb/testsuite/gdb.base/varargs.c | 80 ++++++++++++++++++++++++++++++++++++
gdb/testsuite/gdb.base/varargs.exp | 62 ++++++++++++++++++++++++++++
2 files changed, 142 insertions(+), 0 deletions(-)
diff --git a/gdb/testsuite/gdb.base/varargs.c b/gdb/testsuite/gdb.base/varargs.c
index 1122767..1ad2ffc 100644
--- a/gdb/testsuite/gdb.base/varargs.c
+++ b/gdb/testsuite/gdb.base/varargs.c
@@ -23,6 +23,28 @@ float fa,fb,fc,fd;
double da,db,dc,dd;
double dmax_val;
+#ifdef TEST_COMPLEX
+extern float crealf (float _Complex);
+extern double creal (double _Complex);
+extern long double creall (long double _Complex);
+
+float _Complex fc1 = 1.0F + 1.0iF;
+float _Complex fc2 = 2.0F + 2.0iF;
+float _Complex fc3 = 3.0F + 3.0iF;
+float _Complex fc4 = 4.0F + 4.0iF;
+
+double _Complex dc1 = 1.0 + 1.0i;
+double _Complex dc2 = 2.0 + 2.0i;
+double _Complex dc3 = 3.0 + 3.0i;
+double _Complex dc4 = 4.0 + 4.0i;
+
+long double _Complex ldc1 = 1.0L + 1.0Li;
+long double _Complex ldc2 = 2.0L + 2.0Li;
+long double _Complex ldc3 = 3.0L + 3.0Li;
+long double _Complex ldc4 = 4.0L + 4.0Li;
+
+#endif
+
int main() {
c = -1;
uc = 1;
@@ -109,3 +131,61 @@ double find_max_double(int num_vals, double first_val, ...) {
return max_val;
}
+
+#ifdef TEST_COMPLEX
+float _Complex
+find_max_float_real (int num_vals, ...)
+{
+ float _Complex max = 0.0F + 0.0iF;
+ float _Complex x;
+ va_list argp;
+ int i;
+
+ va_start(argp, num_vals);
+ for (i = 0; i < num_vals; i++)
+ {
+ x = va_arg (argp, float _Complex);
+ if (crealf (max) < crealf (x)) max = x;
+ }
+
+ return max;
+}
+
+double _Complex
+find_max_double_real (int num_vals, ...)
+{
+ double _Complex max = 0.0 + 0.0i;
+ double _Complex x;
+ va_list argp;
+ int i;
+
+ va_start(argp, num_vals);
+ for (i = 0; i < num_vals; i++)
+ {
+ x = va_arg (argp, double _Complex);
+ if (creal (max) < creal (x)) max = x;
+ }
+
+ return max;
+}
+
+long double _Complex
+find_max_long_double_real (int num_vals, ...)
+{
+ long double _Complex max = 0.0L + 0.0iL;
+ long double _Complex x;
+ va_list argp;
+ int i;
+
+ va_start(argp, num_vals);
+ for (i = 0; i < num_vals; i++)
+ {
+ x = va_arg (argp, long double _Complex);
+ if (creall (max) < creal (x)) max = x;
+ }
+
+ return max;
+}
+
+
+#endif /* TEST_COMPLEX */
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
index 4627862..c556bff 100644
--- a/gdb/testsuite/gdb.base/varargs.exp
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -44,6 +44,9 @@ if [get_compiler_info ${binfile}] {
}
set additional_flags {debug}
+if [support_complex_tests] {
+ lappend additional_flags "additional_flags=-DTEST_COMPLEX"
+}
if {$hp_cc_compiler} {
lappend additional_flags "additional_flags=-Ae"
@@ -112,3 +115,62 @@ if {![target_info exists gdb,skip_float_tests]} {
"print find_max_double(5,1.0,17.0,2.0,3.0,4.0)"
}
+
+# Test _Complex type here if supported.
+if [support_complex_tests] {
+ global gdb_prompt
+
+ set test "print find_max_float_real(4, fc1, fc2, fc3, fc4)"
+ gdb_test_multiple $test $test {
+ -re ".*= 4 \\+ 4 \\* I.*${gdb_prompt} $" {
+ pass $test
+ }
+ -re ".*$gdb_prompt $" {
+ if {[istarget "x86_64-*-*"]} {
+ kfail gdb/12790 $test
+ } elseif {[istarget "arm*-*-*"]} {
+ kfail gdb/12791 $test
+ } else {
+ fail $test
+ }
+ }
+ }
+
+ set test "print find_max_double_real(4, dc1, dc2, dc3, dc4)"
+ gdb_test_multiple $test $test {
+ -re ".*= 4 \\+ 4 \\* I.*${gdb_prompt} $" {
+ pass $test
+ }
+ -re ".*$gdb_prompt $" {
+ if {[istarget "i?86-*-*"]} {
+ kfail gdb/12776 $test
+ } elseif {[istarget "x86_64-*-*"]} {
+ kfail gdb/12790 $test
+ } elseif {[istarget "arm*-*-*"]} {
+ kfail gdb/12791 $test
+ } else {
+ fail $test
+ }
+ }
+ }
+
+ set test "print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)"
+ gdb_test_multiple $test $test {
+ -re ".*= 4 \\+ 4 \\* I.*${gdb_prompt} $" {
+ pass $test
+ }
+ -re ".*$gdb_prompt $" {
+ if {[istarget "i?86-*-*"]} {
+ kfail gdb/12776 $test
+ } elseif {[istarget "x86_64-*-*"]} {
+ kfail gdb/12790 $test
+ } elseif {[istarget "arm*-*-*"]} {
+ kfail gdb/12791 $test
+ } else {
+ fail $test
+ }
+ }
+
+ }
+
+}
--
1.7.0.4
next prev parent reply other threads:[~2011-05-20 15:22 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 14:13 [patch, testsuite] Tests to _Complex type Yao Qi
2011-05-06 14:33 ` Joseph S. Myers
2011-05-09 2:24 ` Yao Qi
2011-05-09 15:06 ` Tom Tromey
2011-05-19 4:26 ` [_Complex test 1/4] support_complex_tests in gdb.exp and pass _Complex args to func Yao Qi
2011-05-19 8:16 ` Mark Kettenis
2011-05-19 10:16 ` Joseph S. Myers
2011-05-19 13:26 ` Yao Qi
2011-05-19 17:10 ` Tom Tromey
2011-05-20 8:10 ` Yao Qi
2011-05-26 17:07 ` Tom Tromey
2011-05-30 2:53 ` [committed] " Yao Qi
2011-05-19 13:01 ` Yao Qi
2011-05-19 13:24 ` Mark Kettenis
2011-05-19 13:38 ` Mark Kettenis
2011-05-19 10:12 ` Joseph S. Myers
2011-05-19 4:34 ` [_Complex test 2/4] _Complex type in varargs.exp Yao Qi
2011-05-19 10:13 ` Joseph S. Myers
2011-05-19 13:42 ` Yao Qi
2011-05-19 15:27 ` Joseph S. Myers
2011-05-20 9:09 ` Pedro Alves
2011-05-20 15:22 ` Yao Qi [this message]
2011-05-20 15:37 ` Pedro Alves
2011-05-23 4:09 ` Yao Qi
2011-05-23 10:27 ` Pedro Alves
2011-05-30 2:55 ` [committed] " Yao Qi
2011-05-19 17:12 ` Tom Tromey
2011-05-20 8:11 ` Yao Qi
2011-05-19 4:46 ` [_Complex test 3/4] Isolate each test's effect in callfuncs.exp Yao Qi
2011-05-19 18:46 ` Tom Tromey
2011-05-30 2:56 ` [committed] " Yao Qi
2011-05-19 5:09 ` [_Complex test 4/4] _Complex tests " Yao Qi
2011-05-20 8:17 ` Yao Qi
2011-05-24 1:46 ` [_Complex test 4/4 V3] " Yao Qi
2011-05-24 9:00 ` Mark Kettenis
2011-05-24 9:34 ` Yao Qi
2011-05-24 10:00 ` Mark Kettenis
2011-05-24 13:54 ` Yao Qi
2011-05-26 17:07 ` [_Complex test 4/4] " Tom Tromey
2011-05-30 2:57 ` [committed] " Yao Qi
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=4DD68727.3040502@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=joseph@codesourcery.com \
/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: link
Be 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