Index: gdb/testsuite/gdb.base/enum_cond.exp |
diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/enum_cond.exp |
similarity index 53% |
copy from gdb/testsuite/gdb.base/arrayidx.exp |
copy to gdb/testsuite/gdb.base/enum_cond.exp |
index ed8e17a5379ab646ee1912f1f78bb070556dada0..5c041d94bc8c514881901e577e9ed311af7588ce 100644 |
--- a/gdb/testsuite/gdb.base/arrayidx.exp |
+++ b/gdb/testsuite/gdb.base/enum_cond.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2005, 2007-2012 Free Software Foundation, Inc. |
+# Copyright 2012 Free Software Foundation, Inc. |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -17,44 +17,28 @@ |
# gdb can correctly print arrays with indexes for each element of the |
# array. |
-if $tracelevel { |
- strace $tracelevel |
-} |
- |
-set testfile "arrayidx" |
+set testfile "enum_cond" |
set srcfile ${testfile}.c |
set binfile ${objdir}/${subdir}/${testfile} |
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { |
- untested "Couldn't compile ${srcfile}" |
+ |
+set opts [list debug additional_flags=-fshort-enums] |
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } { |
+ untested "Could not compile ${srcfile}" |
return -1 |
} |
-gdb_exit |
-gdb_start |
-gdb_reinitialize_dir $srcdir/$subdir |
-gdb_load ${binfile} |
+clean_restart $testfile |
if ![runto_main] then { |
- perror "couldn't run to breakpoint" |
+ perror "could not run to main" |
continue |
} |
-# First, print the array without the indexes |
- |
-gdb_test_no_output "set print array-indexes off" \ |
- "Set print array-indexes to off" |
- |
-gdb_test "print array" \ |
- "\\{1, 2, 3, 4\\}" \ |
- "Print array with array-indexes off" |
- |
-# Second, print the same array with the indexes |
- |
-gdb_test_no_output "set print array-indexes on" \ |
- "Set print array-indexes to on" |
- |
-gdb_test "print array" \ |
- "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ |
- "Print array with array-indexes on" |
+gdb_test "break call_me if param.e == 1" \ |
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal\\." |
+# Continue. We should hit our breakpoint... |
+gdb_test "continue" \ |
+ "Breakpoint $decimal, call_me \\(param=\\.\\.\\.\\) at .*" \ |
+ "continue to conditional breakpoint in call_me" |