aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2019-11-09 11:09:41 -0700
committerKevin Buettner <kevinb@redhat.com>2019-12-10 15:42:15 -0700
commitbb47f919bfdb8908361de74a0daf1af208ae425b (patch)
tree90d1a4021d6919c5514b2c3b7db9782305870084 /gdb/testsuite
parent26b911fb6411c930cf408a82604dc4355c086e03 (diff)
downloadgdb-bb47f919bfdb8908361de74a0daf1af208ae425b.zip
gdb-bb47f919bfdb8908361de74a0daf1af208ae425b.tar.gz
gdb-bb47f919bfdb8908361de74a0daf1af208ae425b.tar.bz2
Add gdb_caching_proc support_nested_function_tests to lib/gdb.exp
This commit adds the gdb_caching_proc, support_nested_function_tests, to lib/gdb.exp. It tests to see whether or not the C compiler has support for nested function calls. gdb/testsuite/ChangeLog: * lib/gdb.exp (support_nested_function_tests): New proc. Change-Id: Ic2c93bc4cc200e07e104a2398f89a9c0514bdc75
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/lib/gdb.exp15
2 files changed, 22 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d3510d4..4b2e132 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,8 +1,12 @@
2019-12-10 Kevin Buettner <kevinb@redhat.com>
- * lib/gdb.exp (gdb_compile_openmp): New proc.
- (build_executable_from_specs): Add an "openmp" option.
- (gdb_compile_pthreads): Add non-executable case.
+ * lib/gdb.exp (support_nested_function_tests): New proc.
+
+2019-12-10 Kevin Buettner <kevinb@redhat.com>
+
+ * lib/gdb.exp (gdb_compile_openmp): New proc.
+ (build_executable_from_specs): Add an "openmp" option.
+ (gdb_compile_pthreads): Add non-executable case.
2019-12-10 Tom Tromey <tromey@adacore.com>
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 806e5a0..8b1ec62 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -6395,6 +6395,21 @@ gdb_caching_proc target_supports_scheduler_locking {
return $supports_schedule_locking
}
+# Return 1 if compiler supports use of nested functions. Otherwise,
+# return 0.
+
+gdb_caching_proc support_nested_function_tests {
+ # Compile a test program containing a nested function
+ return [gdb_can_simple_compile nested_func {
+ int main () {
+ int foo () {
+ return 0;
+ }
+ return foo ();
+ }
+ } executable]
+}
+
# gdb_target_symbol returns the provided symbol with the correct prefix
# prepended. (See gdb_target_symbol_prefix, above.)