Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / constvars.exp
index e5874879cf3f4381f3177925ca55300a0904937c..6d1138ca1254a10101b20815d91ff812b30ca375 100644 (file)
@@ -1,21 +1,18 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008
+# 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/>.  */
 
 # written by Elena Zannoni (elz@apollo.hp.com)
 #
@@ -28,8 +25,8 @@
 # with mixed types
 
 if $tracelevel then {
-        strace $tracelevel
-        }
+    strace $tracelevel
+}
 
 #
 # test running programs
@@ -41,10 +38,16 @@ set testfile "constvars"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+    return -1;
 }
 
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug ] != "" } {
+    untested constvars.exp
+    return -1
+}
 
 gdb_exit
 gdb_start
@@ -60,6 +63,35 @@ if ![runto_main] then {
     continue
 }
 
+get_debug_format
+
+# Many tests xfail with gcc 2 -gstabs+.
+# TODO: check out the hp side of this.
+
+proc local_compiler_xfail_check { } {
+    if { [test_compiler_info gcc-2-*] } then {
+       if { ![test_debug_format "HP"] \
+               && ![test_debug_format "DWARF 2"] } then {
+           setup_xfail "*-*-*" 
+       }
+    }
+
+    global hp_cc_compiler
+    if { $hp_cc_compiler } {
+       setup_xfail "hppa*-*-hpux*"
+    }
+}
+
+# A few tests still xfail with gcc 3 -gstabs+ and gcc 4 -gstabs+.
+
+proc local_compiler_xfail_check_2 { } {
+    if { [test_compiler_info gcc-3-*] || [test_compiler_info gcc-4-*] } {
+       if { [test_debug_format "stabs" ] } {
+           setup_xfail "*-*-*"
+       }
+    }
+}
+
 send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
 
     send_gdb "cont\n"
@@ -67,16 +99,26 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
         -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
             send_gdb "up\n"
             gdb_expect {
-                -re ".*$gdb_prompt $" {}
-                timeout { fail "up from marker1" }
+               -re ".*main.*$gdb_prompt $" {
+                   pass "up from marker1"
+               }
+                -re ".*$gdb_prompt $" {
+                   fail "up from marker1"
+               }
+                timeout { fail "up from marker1 (timeout)" }
             }
         }
         -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
            fail "continue to marker1 (demangling)"
             send_gdb "up\n"
             gdb_expect {
-                -re ".*$gdb_prompt $" {}
-                timeout { fail "up from marker1" }
+               -re ".*main.*$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"  }
@@ -84,880 +126,165 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
     }
 
 # test function parameters
+
+local_compiler_xfail_check
+local_compiler_xfail_check_2
+
 send_gdb "ptype qux1\n"
 gdb_expect {
-    -re "type = int \\(const char, const char &, const char \\*, char \\* const\\).*$gdb_prompt $" {
+    -re "type = int \\(const char, const char, const char \\*, char \\* const\\).*$gdb_prompt $" {
         pass "ptype qux1"
     }
     -re ".*$gdb_prompt $" { fail "ptype qux1" }
     timeout           { fail "(timeout) ptype qux1" }
-  }   
+}   
 
 # test vars and pointers
 
-send_gdb "print lave\n"
-gdb_expect {
-    -re ".\[0-9\]* = 66 \'B\'.*$gdb_prompt $" {
-        pass "print value of lave"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lave" }
-    timeout           { fail "(timeout) print value of lave" }
-  }
-
-
-send_gdb "ptype lave\n"
-gdb_expect {
-    -re "type = char.*$gdb_prompt $"  { pass "ptype lave" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lave" }
-    timeout             { fail "(timeout) ptype lave" }
-}
-
-
-send_gdb "print lavish\n"
-gdb_expect {
-    -re ".\[0-9\]* = 10 \'\\\\n\'.*$gdb_prompt $" {
-        pass "print value of lavish"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lavish" }
-    timeout           { fail "(timeout) print value of lavish" }
-  }
-
-
-send_gdb "ptype lavish\n"
-gdb_expect {
-    -re "type = unsigned char.*$gdb_prompt $"  { pass "ptype lavish" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lavish " }
-    timeout             { fail "(timeout) ptype lavish " }
-}
-
-
-send_gdb "print lax\n"
-gdb_expect {
-    -re ".\[0-9\]* = 20.*$gdb_prompt $" {
-        pass "print value of lax"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lax" }
-    timeout           { fail "(timeout) print value of lax" }
-  }
-
-
-send_gdb "ptype lax\n"
-gdb_expect {
-    -re "type = short.*$gdb_prompt $"  { pass "ptype lax" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lax" }
-    timeout             { fail "(timeout) ptype lax" }
-}
-
-
-send_gdb "print lecherous\n"
-gdb_expect {
-    -re ".\[0-9\]* = 30.*$gdb_prompt $" {
-        pass "print value of lecherous"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lecherous" }
-    timeout           { fail "(timeout) print value of lecherous" }
-  }
-
-
-send_gdb "ptype lecherous\n"
-gdb_expect {
-    -re "type = unsigned short.*$gdb_prompt $"  { pass "ptype lecherous" }
-    -re "type = short unsigned.*$gdb_prompt $"  { pass "ptype lecherous" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lecherous" }
-    timeout             { fail "(timeout) ptype lecherous" }
-}
-
-
-send_gdb "print lechery\n"
-gdb_expect {
-    -re ".\[0-9\]* = 40.*$gdb_prompt $" {
-        pass "print value of lechery"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lechery" }
-    timeout           { fail "(timeout) print value of lechery" }
-  }
-
-
-send_gdb "ptype lechery\n"
-gdb_expect {
-    -re "type = long.*$gdb_prompt $"  { pass "ptype lechery" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lechery" }
-    timeout             { fail "(timeout) ptype lechery" }
-}
-
-
-send_gdb "print lectern\n"
-gdb_expect {
-    -re ".\[0-9\]* = 50.*$gdb_prompt $" {
-        pass "print value of lectern"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lectern" }
-    timeout           { fail "(timeout) print value of lectern " }
-  }
-
-
-send_gdb "ptype lectern\n"
-gdb_expect {
-    -re "type = unsigned long.*$gdb_prompt $"  { pass "ptype lectern" }
-    -re "type = long unsigned.*$gdb_prompt $"  { pass "ptype lectern" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lectern" }
-    timeout             { fail "(timeout) ptype lectern" }
-}
-
-
-send_gdb "print leeway\n"
-gdb_expect {
-    -re ".\[0-9\]* = 60.*$gdb_prompt $" {
-        pass "print value of leeway"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of leeway" }
-    timeout           { fail "(timeout) print value of leeway" }
-  }
-
-
-send_gdb "ptype leeway\n"
-gdb_expect {
-    -re "type = float.*$gdb_prompt $"  { pass "ptype leeway" }
-    -re ".*$gdb_prompt $"   {  fail "ptype leeway" }
-    timeout             { fail "(timeout) ptype leeway" }
-}
-
-
-send_gdb "print legacy\n"
-gdb_expect {
-    -re ".\[0-9\]* = 70.*$gdb_prompt $" {
-        pass "print value of legacy"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of legacy" }
-    timeout           { fail "(timeout) print value of legacy" }
-  }
-
-
-send_gdb "ptype legacy\n"
-gdb_expect {
-    -re "type = double.*$gdb_prompt $"  { pass "ptype legacy" }
-    -re ".*$gdb_prompt $"   {  fail "ptype legacy" }
-    timeout             { fail "(timeout) ptype legacy" }
-}
-
-
-send_gdb "print laconic\n"
-gdb_expect {
-    -re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
-        pass "print value of laconic"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of laconic" }
-    timeout           { fail "(timeout) print value of laconic" }
-  }
-
-
-send_gdb "ptype laconic\n"
-gdb_expect {
-    -re "type = const char.*$gdb_prompt $"  { pass "ptype laconic" }
-    -re ".*$gdb_prompt $"   {  fail "ptype laconic" }
-    timeout             { fail "(timeout) ptype laconic" }
-}
-
-
-send_gdb "print laggard\n"
-gdb_expect {
-    -re ".\[0-9\]* = 1 \'.001\'.*$gdb_prompt $" {
-        pass "print value of laggard"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of laggard" }
-    timeout           { fail "(timeout) print value of laggard" }
-  }
-
-
-send_gdb "ptype laggard\n"
-gdb_expect {
-    -re "type = const unsigned char.*$gdb_prompt $"  { pass "ptype laggard" }
-    -re ".*$gdb_prompt $"   {  fail "ptype laggard" }
-    timeout             { fail "(timeout) ptype laggard" }
-}
-
-
-send_gdb "print lagoon\n"
-gdb_expect {
-    -re ".\[0-9\]* = 2.*$gdb_prompt $" {
-        pass "print value of  lagoon"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lagoon" }
-    timeout           { fail "(timeout) print value of lagoon" }
-  }
-
-
-send_gdb "ptype lagoon\n"
-gdb_expect {
-    -re "type = const short.*$gdb_prompt $"  { pass "ptype lagoon" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lagoon" }
-    timeout             { fail "(timeout) ptype lagoon" }
-}
-
-
-send_gdb "print laity\n"
-gdb_expect {
-    -re ".\[0-9\]* = 3.*$gdb_prompt $" {
-        pass "print value of laity"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of laity" }
-    timeout           { fail "(timeout) print value of laity" }
-  }
-
-
-send_gdb "ptype laity\n"
-gdb_expect {
-    -re "type = const unsigned short.*$gdb_prompt $"  { pass "ptype laity" }
-    -re ".*$gdb_prompt $"   {  fail "ptype laity" }
-    timeout             { fail "(timeout) ptype "laity }
-}
-
-
-send_gdb "print lambent\n"
-gdb_expect {
-    -re ".\[0-9\]* = 4.*$gdb_prompt $" {
-        pass "print value of lambent"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lambent" }
-    timeout           { fail "(timeout) print value of lambent" }
-  }
-
-
-send_gdb "ptype lambent\n"
-gdb_expect {
-    -re "type = const long.*$gdb_prompt $"  { pass "ptype lambent" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lambent" }
-    timeout             { fail "(timeout) ptype lambent" }
-}
-
-
-send_gdb "print laminated\n"
-gdb_expect {
-    -re ".\[0-9\]* = 5.*$gdb_prompt $" {
-        pass "print value of laminated"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of laminated" }
-    timeout           { fail "(timeout) print value of laminated" }
-  }
-
-
-send_gdb "ptype laminated\n"
-gdb_expect {
-    -re "type = const unsigned long.*$gdb_prompt $"  { pass "ptype laminated" }
-    -re ".*$gdb_prompt $"   {  fail "ptype laminated" }
-    timeout             { fail "(timeout) ptype laminated" }
-}
-
-
-send_gdb "print lampoon\n"
-gdb_expect {
-    -re ".\[0-9\]* = 6.*$gdb_prompt $" {
-        pass "print value of lampoon"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of lampoon" }
-    timeout           { fail "(timeout) print value of lampoon" }
-  }
-
-
-send_gdb "ptype lampoon\n"
-gdb_expect {
-    -re "type = const float.*$gdb_prompt $"  { pass "ptype lampoon" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lampoon" }
-    timeout             { fail "(timeout) ptype lampoon" }
-}
-
-
-send_gdb "print languid\n"
-gdb_expect {
-    -re ".\[0-9\]* = 7.*$gdb_prompt $" {
-        pass "print value of languid"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of languid" }
-    timeout           { fail "(timeout) print value of languid" }
-  }
-
-
-send_gdb "ptype languid\n"
-gdb_expect {
-    -re "type = const double.*$gdb_prompt $"  { pass "ptype languid" }
-    -re ".*$gdb_prompt $"   {  fail "ptype languid" }
-    timeout             { fail "(timeout) ptype languid" }
-}
-
-
-send_gdb "print *legend\n"
-gdb_expect {
-    -re ".\[0-9\]* = 66 \'B\'.*$gdb_prompt $" {
-        pass "print value of *legend"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *legend" }
-    timeout           { fail "(timeout) print value of *legend" }
-  }
-
-
-send_gdb "ptype legend\n"
-gdb_expect {
-    -re "type = const char \\*.*$gdb_prompt $"  { pass "ptype legend" }
-    -re ".*$gdb_prompt $"   {  fail "ptype legend" }
-    timeout             { fail "(timeout) ptype legend" }
-}
-
-
-send_gdb "print *legerdemain\n"
-gdb_expect {
-    -re ".\[0-9\]* = 10 \'\\\\n\'.*$gdb_prompt $" {
-        pass "print value of  *legerdemain"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of  *legerdemain" }
-    timeout           { fail "(timeout) print value of  *legerdemain" }
-  }
-
-
-send_gdb "ptype  legerdemain\n"
-gdb_expect {
-    -re "type = const unsigned char \\*.*$gdb_prompt $"  { pass "ptype  legerdemain" }
-    -re ".*$gdb_prompt $"   {  fail "ptype  legerdemain" }
-    timeout             { fail "(timeout) ptype  legerdemain" }
-}
-
-
-send_gdb "print *leniency\n"
-gdb_expect {
-    -re ".\[0-9\]* = 20.*$gdb_prompt $" {
-        pass "print value of *leniency"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *leniency" }
-    timeout           { fail "(timeout) print value of *leniency" }
-  }
-
-
-send_gdb "ptype leniency\n"
-gdb_expect {
-    -re "type = const short \\*.*$gdb_prompt $"  { pass "ptype leniency" }
-    -re ".*$gdb_prompt $"   {  fail "ptype leniency " }
-    timeout             { fail "(timeout) ptype leniency" }
-}
-
-
-send_gdb "print *leonine\n"
-gdb_expect {
-    -re ".\[0-9\]* = 30.*$gdb_prompt $" {
-        pass "print value of *leonine"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *leonine" }
-    timeout           { fail "(timeout) print value of *leonine" }
-  }
-
-
-send_gdb "ptype leonine\n"
-gdb_expect {
-    -re "type = const unsigned short \\*.*$gdb_prompt $"  { pass "ptype leonine" }
-    -re ".*$gdb_prompt $"   {  fail "ptype leonine" }
-    timeout             { fail "(timeout) ptype leonine" }
-}
-
-
-send_gdb "print *lesion\n"
-gdb_expect {
-    -re ".\[0-9\]* = 40.*$gdb_prompt $" {
-        pass "print value of *lesion"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lesion" }
-    timeout           { fail "(timeout) print value of *lesion" }
-  }
-
-
-send_gdb "ptype lesion\n"
-gdb_expect {
-    -re "type = const long \\*.*$gdb_prompt $"  { pass "ptype lesion" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lesion" }
-    timeout             { fail "(timeout) ptype lesion" }
-}
-
-
-send_gdb "print *lethal\n"
-gdb_expect {
-    -re ".\[0-9\]* = 50.*$gdb_prompt $" {
-        pass "print value of *lethal"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lethal" }
-    timeout           { fail "(timeout) print value of *lethal" }
-  }
-
-
-send_gdb "ptype lethal\n"
-gdb_expect {
-    -re "type = const unsigned long \\*.*$gdb_prompt $"  { pass "ptype lethal" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lethal" }
-    timeout             { fail "(timeout) ptype lethal" }
-}
-
-
-send_gdb "print *lethargic\n"
-gdb_expect {
-    -re ".\[0-9\]* = 60.*$gdb_prompt $" {
-        pass "print value of *lethargic"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lethargic" }
-    timeout           { fail "(timeout) print value of *lethargic" }
-  }
-
-
-send_gdb "ptype lethargic\n"
-gdb_expect {
-    -re "type = const float \\*.*$gdb_prompt $"  { pass "ptype lethargic" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lethargic" }
-    timeout             { fail "(timeout) ptype lethargic" }
-}
-
-
-send_gdb "print *levity\n"
-gdb_expect {
-    -re ".\[0-9\]* = 70.*$gdb_prompt $" {
-        pass "print value of *levity"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *levity" }
-    timeout           { fail "(timeout) print value of *levity" }
-  }
-
-
-send_gdb "ptype levity\n"
-gdb_expect {
-    -re "type = const double \\*.*$gdb_prompt $"  { pass "ptype levity" }
-    -re ".*$gdb_prompt $"   {  fail "ptype levity" }
-    timeout             { fail "(timeout) ptype levity" }
-}
-
-
-send_gdb "print *lewd\n"
-gdb_expect {
-    -re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
-        pass "print value of *lewd"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lewd" }
-    timeout           { fail "(timeout) print value of *lewd" }
-  }
-
-
-send_gdb "ptype lewd\n"
-gdb_expect {
-    -re "type = const char \\* const.*$gdb_prompt $"  { pass "ptype lewd" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lewd" }
-    timeout             { fail "(timeout) ptype lewd" }
-}
-
-
-send_gdb "print *lexicographer\n"
-gdb_expect {
-    -re ".\[0-9\]* = 1 \'.001\'.*$gdb_prompt $" {
-        pass "print value of *lexicographer"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lexicographer" }
-    timeout           { fail "(timeout) print value of *lexicographer" }
-  }
-
-
-send_gdb "ptype lexicographer\n"
-gdb_expect {
-    -re "type = const unsigned char \\* const.*$gdb_prompt $"  { pass "ptype lexicographer" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lexicographer" }
-    timeout             { fail "(timeout) ptype lexicographer" }
-}
-
-
-send_gdb "print *lexicon\n"
-gdb_expect {
-    -re ".\[0-9\]* = 2.*$gdb_prompt $" {
-        pass "print value of *lexicon"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lexicon" }
-    timeout           { fail "(timeout) print value of *lexicon" }
-  }
-
-
-send_gdb "ptype lexicon\n"
-gdb_expect {
-    -re "type = const short \\* const.*$gdb_prompt $"  { pass "ptype lexicon" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lexicon" }
-    timeout             { fail "(timeout) ptype lexicon" }
-}
-
-
-send_gdb "print *liaison\n"
-gdb_expect {
-    -re ".\[0-9\]* = 3.*$gdb_prompt $" {
-        pass "print value of *liaison"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *liaison" }
-    timeout           { fail "(timeout) print value of *liaison" }
-  }
-
-
-send_gdb "ptype liaison\n"
-gdb_expect {
-    -re "type = const unsigned short \\* const.*$gdb_prompt $"  { pass "ptype liaison" }
-    -re ".*$gdb_prompt $"   {  fail "ptype liaison" }
-    timeout             { fail "(timeout) ptype liaison" }
-}
-
-
-send_gdb "print *libation\n"
-gdb_expect {
-    -re ".\[0-9\]* = 4.*$gdb_prompt $" {
-        pass "print value of *libation"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *libation" }
-    timeout           { fail "(timeout) print value of *libation" }
-  }
-
-
-send_gdb "ptype libation\n"
-gdb_expect {
-    -re "type = const long \\* const.*$gdb_prompt $"  { pass "ptype libation" }
-    -re ".*$gdb_prompt $"   {  fail "ptype libation" }
-    timeout             { fail "(timeout) ptype libation" }
-}
-
-
-send_gdb "print *libelous\n"
-gdb_expect {
-    -re ".\[0-9\]* = 5.*$gdb_prompt $" {
-        pass "print value of *libelous"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *libelous" }
-    timeout           { fail "(timeout) print value of *libelous" }
-  }
-
-
-send_gdb "ptype libelous\n"
-gdb_expect {
-    -re "type = const unsigned long \\* const.*$gdb_prompt $"  { pass "ptype libelous" }
-    -re ".*$gdb_prompt $"   {  fail "ptype libelous" }
-    timeout             { fail "(timeout) ptype libelous" }
-}
-
-
-send_gdb "print *libertine\n"
-gdb_expect {
-    -re ".\[0-9\]* = 6.*$gdb_prompt $" {
-        pass "print value of *libertine"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *libertine" }
-    timeout           { fail "(timeout) print value of *libertine" }
-  }
-
-
-send_gdb "ptype libertine\n"
-gdb_expect {
-    -re "type = const float \\* const.*$gdb_prompt $"  { pass "ptype libertine" }
-    -re ".*$gdb_prompt $"   {  fail "ptype libertine" }
-    timeout             { fail "(timeout) ptype libertine" }
-}
-
-
-send_gdb "print *libidinous\n"
-gdb_expect {
-    -re ".\[0-9\]* = 7.*$gdb_prompt $" {
-        pass "print value of *libidinous"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *libidinous" }
-    timeout           { fail "(timeout) print value of *libidinous" }
-  }
-
-
-send_gdb "ptype libidinous\n"
-gdb_expect {
-    -re "type = const double \\* const.*$gdb_prompt $"  { pass "ptype libidinous" }
-    -re ".*$gdb_prompt $"   {  fail "ptype libidinous" }
-    timeout             { fail "(timeout) ptype libidinous" }
-}
-
-
-send_gdb "print *languish\n"
-gdb_expect {
-    -re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
-        pass "print value of *languish"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *languish" }
-    timeout           { fail "(timeout) print value of *languish" }
-  }
-
-
-send_gdb "ptype languish\n"
-gdb_expect {
-    -re "type = const char \\*.*$gdb_prompt $"  { pass "ptype languish" }
-    -re ".*$gdb_prompt $"   {  fail "ptype languish" }
-    timeout             { fail "(timeout) ptype languish" }
-}
-
-
-send_gdb "print *languor\n"
-gdb_expect {
-    -re ".\[0-9\]* = 1 \'.001\'.*$gdb_prompt $" {
-        pass "print value of *languor"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *languor" }
-    timeout           { fail "(timeout) print value of *languor" }
-  }
-
-
-send_gdb "ptype languor\n"
-gdb_expect {
-    -re "type = const unsigned char \\*.*$gdb_prompt $"  { pass "ptype languor" }
-    -re ".*$gdb_prompt $"   {  fail "ptype languor" }
-    timeout             { fail "(timeout) ptype languor" }
-}
-
-
-send_gdb "print *lank\n"
-gdb_expect {
-    -re ".\[0-9\]* = 2.*.*$gdb_prompt $" {
-        pass "print value of *lank"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lank" }
-    timeout           { fail "(timeout) print value of *lank" }
-  }
-
-
-send_gdb "ptype lank\n"
-gdb_expect {
-    -re "type = const short \\*.*$gdb_prompt $"  { pass "ptype lank" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lank" }
-    timeout             { fail "(timeout) ptype lank" }
-}
-
-
-send_gdb "print *lapidary\n"
-gdb_expect {
-    -re ".\[0-9\]* = 3.*$gdb_prompt $" {
-        pass "print value of *lapidary"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lapidary" }
-    timeout           { fail "(timeout) print value of *lapidary" }
-  }
-
-
-send_gdb "ptype lapidary\n"
-gdb_expect {
-    -re "type = const unsigned short \\*.*$gdb_prompt $"  { pass "ptype lapidary" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lapidary" }
-    timeout             { fail "(timeout) ptype lapidary" }
-}
-
-
-send_gdb "print *larceny\n"
-gdb_expect {
-    -re ".\[0-9\]* = 4.*$gdb_prompt $" {
-        pass "print value of *larceny"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *larceny" }
-    timeout           { fail "(timeout) print value of *larceny" }
-  }
-
-
-send_gdb "ptype larceny\n"
-gdb_expect {
-    -re "type = const long \\*.*$gdb_prompt $"  { pass "ptype larceny" }
-    -re ".*$gdb_prompt $"   {  fail "ptype larceny" }
-    timeout             { fail "(timeout) ptype larceny" }
-}
-
-
-send_gdb "print *largess\n"
-gdb_expect {
-    -re ".\[0-9\]* = 5.*$gdb_prompt $" {
-        pass "print value of *largess"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *largess" }
-    timeout           { fail "(timeout) print value of *largess" }
-  }
-
-
-send_gdb "ptype largess\n"
-gdb_expect {
-    -re "type = const unsigned long \\*.*$gdb_prompt $"  { pass "ptype largess" }
-    -re ".*$gdb_prompt $"   {  fail "ptype largess" }
-    timeout             { fail "(timeout) ptype largess" }
-}
-
-
-send_gdb "print *lascivious\n"
-gdb_expect {
-    -re ".\[0-9\]* = 6.*$gdb_prompt $" {
-        pass "print value of *lascivious"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lascivious" }
-    timeout           { fail "(timeout) print value of *lascivious" }
-  }
-
-
-send_gdb "ptype lascivious\n"
-gdb_expect {
-    -re "type = const float \\*.*$gdb_prompt $"  { pass "ptype lascivious" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lascivious" }
-    timeout             { fail "(timeout) ptype lascivious" }
-}
-
-
-send_gdb "print *lassitude\n"
-gdb_expect {
-    -re ".\[0-9\]* = 7.*$gdb_prompt $" {
-        pass "print value of *lassitude"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lassitude" }
-    timeout           { fail "(timeout) print value of *lassitude" }
-  }
-
-
-send_gdb "ptype lassitude\n"
-gdb_expect {
-    -re "type = const double \\*.*$gdb_prompt $"  { pass "ptype lassitude" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lassitude" }
-    timeout             { fail "(timeout) ptype lassitude" }
-}
-
-     
-send_gdb "print *lamprey\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 66 \'B\'.*$gdb_prompt $" {
-        pass "print value of *lamprey"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lamprey" }
-    timeout           { fail "(timeout) print value of *lamprey" }
-  }
-
-
-send_gdb "ptype lamprey\n"
-gdb_expect {
-    -re "type = char \\* const.*$gdb_prompt $"  { pass "ptype lamprey" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lamprey" }
-    timeout             { fail "(timeout) ptype lamprey" }
-}
-
-send_gdb "print *lariat\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 10 \'\\\\n\'.*$gdb_prompt $" {
-        pass "print value of *lariat"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lariat" }
-    timeout           { fail "(timeout) print value of *lariat" }
-  }
-
-
-send_gdb "ptype lariat\n"
-gdb_expect {
-    -re "type = unsigned char \\* const.*$gdb_prompt $"  { pass "ptype lariat" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lariat" }
-    timeout             { fail "(timeout) ptype lariat" }
-}
-
-send_gdb "print *laudanum\n"
-gdb_expect {
-    -re ".\[0-9\]* = 20.*$gdb_prompt $" {
-        pass "print value of *laudanum"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *laudanum" }
-    timeout           { fail "(timeout) print value of *laudanum" }
-  }
-
-
-send_gdb "ptype laudanum\n"
-gdb_expect {
-    -re "type = short \\* const.*$gdb_prompt $"  { pass "ptype laudanum" }
-    -re ".*$gdb_prompt $"   {  fail "ptype laudanum" }
-    timeout             { fail "(timeout) ptype laudanum" }
-}
-
-send_gdb "print *lecithin\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 30.*$gdb_prompt $" {
-        pass "print value of *lecithin"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lecithin" }
-    timeout           { fail "(timeout) print value of *lecithin" }
-  }
-
-
-send_gdb "ptype lecithin\n"
-gdb_expect {
-    -re "type = unsigned short \\* const.*$gdb_prompt $"  { pass "ptype lecithin" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lecithin" }
-    timeout             { fail "(timeout) ptype lecithin" }
-}
-
-send_gdb "print *leviathan\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 40.*$gdb_prompt $" {
-        pass "print value of *leviathan"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *leviathan" }
-    timeout           { fail "(timeout) print value of *leviathan" }
-  }
-
-
-send_gdb "ptype leviathan\n"
-gdb_expect {
-    -re "type = long \\* const.*$gdb_prompt $"  { pass "ptype leviathan" }
-    -re ".*$gdb_prompt $"   {  fail "ptype leviathan" }
-    timeout             { fail "(timeout) ptype leviathan" }
-}
-
-send_gdb "print *libretto\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 50.*$gdb_prompt $" {
-        pass "print value of *libretto"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *libretto" }
-    timeout           { fail "(timeout) print value of *libretto" }
-  }
-
-
-send_gdb "ptype libretto\n"
-gdb_expect {
-    -re "type = unsigned long \\* const.*$gdb_prompt $"  { pass "ptype libretto" }
-    -re ".*$gdb_prompt $"   {  fail "ptype libretto" }
-    timeout             { fail "(timeout) ptype libretto" }
-}
-
-
-send_gdb "print *lissome\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 60.*$gdb_prompt $" {
-        pass "print value of *lissome"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *lissome" }
-    timeout           { fail "(timeout) print value of *lissome" }
-  }
-
-
-send_gdb "ptype lissome\n"
-gdb_expect {
-    -re "type = float \\* const.*$gdb_prompt $"  { pass "ptype lissome" }
-    -re ".*$gdb_prompt $"   {  fail "ptype lissome" }
-    timeout             { fail "(timeout) ptype lissome" }
-}
-
-send_gdb "print *locust\n"
-gdb_expect {
-    -re  ".\[0-9\]* = 70.*$gdb_prompt $" {
-        pass "print value of *locust"
-      }
-    -re ".*$gdb_prompt $" { fail "print value of *locust" }
-    timeout           { fail "(timeout) print value of *locust" }
-  }
-
-
-send_gdb "ptype locust\n"
-gdb_expect {
-    -re "type = double \\* const.*$gdb_prompt $"  { pass "ptype locust" }
-    -re ".*$gdb_prompt $"   {  fail "ptype locust" }
-    timeout             { fail "(timeout) ptype locust" }
-}
-
-send_gdb "ptype radiation\n"
-gdb_expect {
-    -re "type = const char &.*$gdb_prompt $"  { pass "ptype radiation" }
-    -re ".*$gdb_prompt $"   {  fail "ptype radiation" }
-    timeout             { fail "(timeout) ptype radiation" }
-}
-
+proc do_constvar_tests {} {
+    gdb_test "print lave" " = 66 'B'"
+    gdb_test "ptype lave" "type = char"
+    gdb_test "print lavish" " = 10 '\\\\n'"
+    gdb_test "ptype lavish" "type = unsigned char"
+    gdb_test "print lax" " = 20"
+    gdb_test "ptype lax" "type = short.*"
+    gdb_test "print lecherous" " = 30"
+    gdb_test "ptype lecherous" "type = (unsigned short|short unsigned)( int)?"
+    gdb_test "print lechery" " = 40"
+    gdb_test "ptype lechery" "type = long.*"
+    gdb_test "print lectern" " = 50"
+    gdb_test "ptype lectern" "type = (unsigned long|long unsigned)( int)?"
+    gdb_test "print leeway" " = 60"
+    gdb_test "ptype leeway" "type = float"
+    gdb_test "print legacy" " = 70"
+    gdb_test "ptype legacy" "type = double"
+    gdb_test "print laconic" " = 65 'A'"
+    local_compiler_xfail_check
+    gdb_test "ptype laconic" "type = const char"
+    gdb_test "print laggard" " = 1 '.001'"
+    local_compiler_xfail_check
+    gdb_test "ptype laggard" "type = const unsigned char"
+    gdb_test "print lagoon" " = 2"
+    local_compiler_xfail_check
+    gdb_test "ptype lagoon" "type = const short( int)?"
+    gdb_test "print laity" " = 3"
+    local_compiler_xfail_check
+    gdb_test "ptype laity" "type = const (unsigned short|short unsigned)( int)?"
+    gdb_test "print lambent" " = 4"
+    local_compiler_xfail_check
+    gdb_test "ptype lambent" "type = const long( int)?"
+    gdb_test "print laminated" " = 5"
+    local_compiler_xfail_check
+    gdb_test "ptype laminated" "type = const (unsigned long|long unsigned)( int)?"
+    gdb_test "print lampoon" " = 6"
+    local_compiler_xfail_check
+    gdb_test "ptype lampoon" "type = const float"
+    gdb_test "print languid" " = 7"
+    local_compiler_xfail_check
+    gdb_test "ptype languid" "type = const double"
+    gdb_test "print *legend" " = 66 'B'"
+    local_compiler_xfail_check
+    gdb_test "ptype legend" "type = const char \\*"
+    gdb_test "print *legerdemain" " = 10 '\\\\n'"
+    local_compiler_xfail_check
+    gdb_test "ptype legerdemain" "type = const unsigned char \\*"
+    gdb_test "print *leniency" " = 20"
+    local_compiler_xfail_check
+    gdb_test "ptype leniency" "type = const short( int)? \\*"
+    gdb_test "print *leonine" " = 30"
+    local_compiler_xfail_check
+    gdb_test "ptype leonine" "type = const (unsigned short|short unsigned)( int)? \\*"
+    gdb_test "print *lesion" " = 40"
+    local_compiler_xfail_check
+    gdb_test "ptype lesion" "type = const long( int)? \\*"
+    gdb_test "print *lethal" " = 50"
+    local_compiler_xfail_check
+    gdb_test "ptype lethal" "type = const (unsigned long|long unsigned)( int)? \\*"
+    gdb_test "print *lethargic" " = 60"
+    local_compiler_xfail_check
+    gdb_test "ptype lethargic" "type = const float \\*"
+    gdb_test "print *levity" " = 70"
+    local_compiler_xfail_check
+    gdb_test "ptype levity" "type = const double \\*"
+    gdb_test "print *lewd" " = 65 'A'"
+    local_compiler_xfail_check
+    gdb_test "ptype lewd" "type = const char \\* const"
+    gdb_test "print *lexicographer" " = 1 '.001'"
+    local_compiler_xfail_check
+    gdb_test "ptype lexicographer" "type = const unsigned char \\* const"
+    gdb_test "print *lexicon" " = 2"
+    local_compiler_xfail_check
+    gdb_test "ptype lexicon" "type = const short( int)? \\* const"
+    gdb_test "print *liaison" " = 3"
+    local_compiler_xfail_check
+    gdb_test "ptype liaison" "type = const (unsigned short|short unsigned)( int)? \\* const"
+    gdb_test "print *libation" " = 4"
+    local_compiler_xfail_check
+    gdb_test "ptype libation" "type = const long( int)? \\* const"
+    gdb_test "print *libelous" " = 5"
+    local_compiler_xfail_check
+    gdb_test "ptype libelous" "type = const (unsigned long|long unsigned)( int)? \\* const"
+    gdb_test "print *libertine" " = 6"
+    local_compiler_xfail_check
+    gdb_test "ptype libertine" "type = const float \\* const"
+    gdb_test "print *libidinous" " = 7"
+    local_compiler_xfail_check
+    gdb_test "ptype libidinous" "type = const double \\* const"
+    gdb_test "print *languish" " = 65 'A'"
+    local_compiler_xfail_check
+    gdb_test "ptype languish" "type = const char \\*"
+    gdb_test "print *languor" " = 1 '.001'"
+    local_compiler_xfail_check
+    gdb_test "ptype languor" "type = const unsigned char \\*"
+    gdb_test "print *lank" " = 2"
+    local_compiler_xfail_check
+    gdb_test "ptype lank" "type = const short( int)? \\*"
+    gdb_test "print *lapidary" " = 3"
+    local_compiler_xfail_check
+    gdb_test "ptype lapidary" "type = const (unsigned short|short unsigned)( int)? \\*"
+    gdb_test "print *larceny" " = 4"
+    local_compiler_xfail_check
+    gdb_test "ptype larceny" "type = const long( int)? \\*"
+    gdb_test "print *largess" " = 5"
+    local_compiler_xfail_check
+    gdb_test "ptype largess" "type = const (unsigned long|long unsigned)( int)? \\*"
+    gdb_test "print *lascivious" " = 6"
+    local_compiler_xfail_check
+
+    gdb_test "ptype lascivious" "type = const float \\*"
+    gdb_test "print *lassitude" " = 7"
+    local_compiler_xfail_check
+    gdb_test "ptype lassitude" "type = const double \\*"
+    gdb_test "print *lamprey" " = 66 'B'"
+    local_compiler_xfail_check
+    gdb_test "ptype lamprey" "type = char \\* const"
+    gdb_test "print *lariat" " = 10 '\\\\n'"
+    local_compiler_xfail_check
+    gdb_test "ptype lariat" "type = unsigned char \\* const"
+    gdb_test "print *laudanum" " = 20"
+    local_compiler_xfail_check
+    gdb_test "ptype laudanum" "type = short( int)? \\* const"
+    gdb_test "print *lecithin" " = 30"
+    local_compiler_xfail_check
+    gdb_test "ptype lecithin" "type = (unsigned short|short unsigned)( int)? \\* const"
+    gdb_test "print *leviathan" " = 40"
+    local_compiler_xfail_check
+    gdb_test "ptype leviathan" "type = long( int)? \\* const"
+    gdb_test "print *libretto" " = 50"
+    local_compiler_xfail_check
+    gdb_test "ptype libretto" "type = (unsigned long|long unsigned)( int)? \\* const"
+    gdb_test "print *lissome" " = 60"
+    local_compiler_xfail_check
+    gdb_test "ptype lissome" "type = float \\* const"
+    gdb_test "print *locust" " = 70"
+    local_compiler_xfail_check
+    gdb_test "ptype locust" "type = double \\* const"
+
+    local_compiler_xfail_check
+    local_compiler_xfail_check_2
+    gdb_test "ptype crass" "type = struct crass \{\[\r\n\]+\[\ \t\]+char \\* const ptr;\[\r\n\]+\}"
+    local_compiler_xfail_check
+    gdb_test "ptype crisp" "type = struct crisp \{\[\r\n\]+\[\ \t\]+char \\* const \\*ptr;\[\r\n\]+\}"
+}
+
+do_constvar_tests
This page took 0.034956 seconds and 4 git commands to generate.