summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/complex-parts.exp
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-04-01 14:09:52 -0600
committerTom Tromey <tromey@adacore.com>2020-04-01 14:09:53 -0600
commit3638a098a21ce706ef2b17185f3b165e4f9a5c54 (patch)
tree2e28dcfa81cff0a6b027e967326e75802440f660 /gdb/testsuite/gdb.base/complex-parts.exp
parentc34e87146628a14cf662dca46aac893d06502f52 (diff)
downloadbinutils-gdb-3638a098a21ce706ef2b17185f3b165e4f9a5c54.tar.gz
Add _Complex type support to C parser
This changes the C parser to add support for complex types in casts. gdb/ChangeLog 2020-04-01 Tom Tromey <tom@tromey.com> * c-exp.y (FLOAT_KEYWORD, COMPLEX): New tokens. (scalar_type): New rule, from typebase. (typebase): Use scalar_type. Recognize complex types. (field_name): Handle FLOAT_KEYWORD. (ident_tokens): Add _Complex and __complex__. gdb/testsuite/ChangeLog 2020-04-01 Tom Tromey <tom@tromey.com> * gdb.base/complex-parts.exp: Add type tests.
Diffstat (limited to 'gdb/testsuite/gdb.base/complex-parts.exp')
-rw-r--r--gdb/testsuite/gdb.base/complex-parts.exp5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/complex-parts.exp b/gdb/testsuite/gdb.base/complex-parts.exp
index 0cf4abf56ec..38aad395ad2 100644
--- a/gdb/testsuite/gdb.base/complex-parts.exp
+++ b/gdb/testsuite/gdb.base/complex-parts.exp
@@ -86,3 +86,8 @@ gdb_test "print (5 + 7i) != (8 + 7i)" " = 1"
gdb_test "print (5 + 7i) != (5 + 92i)" " = 1"
gdb_test "print (20 - 4i) / (3 + 2i)" " = 4 \\+ -4i"
+
+gdb_test "print (_Complex int) 4" " = 4 \\+ 0i"
+gdb_test "print (_Complex float) 4.5" " = 4.5 \\+ 0i"
+gdb_test "ptype __complex__ short" " = _Complex short"
+gdb_test "print (_Complex int) (23.75 + 8.88i)" " = 23 \\+ 8i"