]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/miscexprs.exp
* gdb.base/miscexprs.c (main): Add usage of preprocessor
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / miscexprs.exp
index 795fc3eb8cd81acfd6fcf259d295378b92ecd63e..ad8e11d837fd28c09b752f47b7536ed204797ccc 100644 (file)
@@ -30,6 +30,17 @@ if $tracelevel then {
         strace $tracelevel
         }
 
+# By default, the datastructures are allocated on the stack.  For targets
+# with very small stack, that will not work.  In that case, just set
+# storage to `-DSTORAGE=static' which changes the datastructures to be
+# allocated in data segment.
+set storage "-DSTORAGE="
+if [target_info exists gdb,small_stack_section] {
+    set storage "-DSTORAGE=static"
+}
+
+set additional_flags "additional_flags=-w ${storage}"
+
 #
 # test running programs
 #
@@ -40,7 +51,7 @@ set testfile "miscexprs"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ${additional_flags}]] != "" } {
     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }