Update copyright year in most headers.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / pointers.exp
index 539f875b71c46f07f3335318ef6896e30b0ced4c..38e7340862ca0df1aa4760205d0f8fd3c981542c 100644 (file)
@@ -1,21 +1,18 @@
-# Copyright (C) 1998 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2000, 2007, 2008, 2009, 2010
+# 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
 
@@ -39,8 +36,9 @@ set testfile "pointers"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
+     untested pointers.exp
+     return -1
     }
 
 if [get_compiler_info ${binfile}] {
@@ -366,18 +364,28 @@ gdb_expect {
 
 send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
 
-    send_gdb "cont\n"
-    gdb_expect {
-        -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
-            send_gdb "up\n"
-            gdb_expect {
-                -re ".*$gdb_prompt $" {}
-                timeout { fail "up from marker1" }
-            }
-        }
-        -re "$gdb_prompt $" { fail "continue to marker1"  }
-        timeout { fail "(timeout) continue to marker1"  }
+send_gdb "cont\n"
+gdb_expect {
+    -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+       pass "continue to marker1"
+       send_gdb "up\n"
+       gdb_expect {
+           -re ".*more_code.*$gdb_prompt $" {
+               pass "up from marker1"
+           }
+           -re ".*$gdb_prompt $" {
+               fail "up from marker1"
+           }
+           timeout { fail "up from marker1 (timeout)" }
+       }
+    }
+    -re "$gdb_prompt $" {
+       fail "continue to marker1"
+    }
+    timeout {
+       fail "continue to marker1 (timeout)"
     }
+}
 
 
 send_gdb "print *pUC\n"
@@ -505,7 +513,7 @@ gdb_expect {
 
 send_gdb "print *pF\n"
 gdb_expect {
-    -re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
+    -re ".\[0-9\]* = 1.2\[0-9\]*e\\+0?10.*$gdb_prompt $" {
         pass "print value of *pF"
       }
     -re ".*$gdb_prompt $" { fail "print value of *pF" }
@@ -522,7 +530,7 @@ gdb_expect {
 
 send_gdb "print *pD\n"
 gdb_expect {
-    -re ".\[0-9\]* = -1.375e-123.*$gdb_prompt $" {
+    -re ".\[0-9\]* = -1.2\[0-9\]*e\\-0?37.*$gdb_prompt $" {
         pass "print value of *pD"
       }
     -re ".*$gdb_prompt $" { fail "print value of *pD" }
@@ -563,7 +571,7 @@ gdb_expect {
 
 send_gdb "ptype pppC\n"
 gdb_expect {
-    -re "type = char \\*\\*\\*.*$gdb_prompt $"  { pass "ptype  pppC" }
+    -re "type = char \\*\\*\\*.*$gdb_prompt $"  { pass "ptype pppC" }
     -re ".*$gdb_prompt $"   {  fail "ptype pppC" }
     timeout             { fail "(timeout) ptype pppC" }
 }
@@ -589,3 +597,7 @@ gdb_expect {
     timeout             { fail "(timeout) ptype ppppppC" }
 }
 
+# Regression test for a crash.
+
+gdb_test "p instance.array_variable + 0" \
+  " = \\(long int \\*\\) 0x\[0-9a-f\]*"
This page took 0.024701 seconds and 4 git commands to generate.