diff options
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/enum_cond.c | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/enum_cond.exp | 15 |
2 files changed, 30 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/enum_cond.c b/gdb/testsuite/gdb.base/enum_cond.c index 35e126a..df8830f 100644 --- a/gdb/testsuite/gdb.base/enum_cond.c +++ b/gdb/testsuite/gdb.base/enum_cond.c @@ -46,3 +46,19 @@ main (void) return 0; } +void +exit (int status) +{ +#if HAVE_BUILTIN_TRAP + __builtin_trap (); +#endif + while (1) + ; +} + +void +_start (void) +{ + main (); + exit (0); +} diff --git a/gdb/testsuite/gdb.base/enum_cond.exp b/gdb/testsuite/gdb.base/enum_cond.exp index 3ee90f8..d58da47 100644 --- a/gdb/testsuite/gdb.base/enum_cond.exp +++ b/gdb/testsuite/gdb.base/enum_cond.exp @@ -19,7 +19,20 @@ standard_testfile .c -set opts [list debug additional_flags=-fshort-enums] +set opts {} +lappend opts debug +lappend opts additional_flags=-fshort-enums +# Without -nostdlib, on arm we run into: +# +# ld: warning: enum_cond.o uses variable-size enums yet the output is to use +# 32-bit enums; use of enum values across objects may fail +# +# due to conflicting values for Tag_ABI_enum_size between enum_cond.o and +# linked-in objects. Work around this by using -nostdlib, making sure there's +# just one object, and no such conflict can happen. +lappend opts additional_flags=-nostdlib +lappend opts additional_flags=-DHAVE_BUILTIN_TRAP=[have_builtin_trap] + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } { untested "failed to compile" return -1 |