This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfa/testsuite] constvars.exp, volatile.exp: hp-ux
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 7 Jan 2004 17:38:49 -0500 (EST)
- Subject: [rfa/testsuite] constvars.exp, volatile.exp: hp-ux
This patch improves constvars.exp and volatile.exp to work with
the HP compilers on hp-ux.
First, there was some code to force use of the HP C++ compiler instead
of the HP C compiler. I killed that. The user decides at a higher
level which compilers to use for which languages.
That bit of code wasn't even helping because HP C++ returns a (valid)
compiler error for constvars.c. For the curious, this line is
not valid C++:
# Uninitialized const/reference member in class/aggregate.
struct crass { char * const ptr; } crass;
Since ptr itself is const, it can't be changed after it's initialized,
so it must be initialized.
I'm not dealing with that right now. gdb.base/*.c does not have to
compile with a C++ compiler.
Second, I removed a duplicate call to get_compiler_info. That's
just cleanup.
Third, in local_compiler_xfail_check, I added setup_xfail for
$hp_cc_compiler. The HP Ansi C compiler does not emit const qualifiers,
so this is really an XFAIL, a limitation in the external compiler. I
checked that by stepping through hpread.c by hand.
Tested on:
native hppa2.0w-hp-hpux11.11, hp ansi c
Okay to commit?
Michael C
2004-01-07 Michael Chastain <mec.gnu@mindspring.com>
* gdb.base/constvars.exp: Do not force lang=c++ if using HP
compilers. Delete duplicate call to get_compiler_info.
(local_compiler_xfail_check): setup_xfail if $hp_cc_compiler.
* gdb.base/volatile.exp: Likewise.
diff -c3p -r /house/chastain/HEAD/src/gdb/testsuite/gdb.base/constvars.exp gdb.base/constvars.exp
*** /house/chastain/HEAD/src/gdb/testsuite/gdb.base/constvars.exp 2003-11-29 01:56:06.000000000 -0500
--- gdb.base/constvars.exp 2004-01-07 16:47:17.000000000 -0500
***************
*** 1,4 ****
! # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
*************** if [get_compiler_info ${binfile}] {
*** 48,70 ****
return -1;
}
! if {$hp_aCC_compiler || $hp_cc_compiler} {
! set lang "c++"
! } else {
! set lang ""
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug $lang]] != "" } {
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;
- }
-
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
--- 48,57 ----
return -1;
}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug ] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
*************** proc local_compiler_xfail_check { } {
*** 88,93 ****
--- 75,85 ----
setup_xfail "*-*-*"
}
}
+
+ global hp_cc_compiler
+ if { $hp_cc_compiler } {
+ setup_xfail "hppa*-*-hpux*"
+ }
}
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
diff -c3p -r /house/chastain/HEAD/src/gdb/testsuite/gdb.base/volatile.exp gdb.base/volatile.exp
*** /house/chastain/HEAD/src/gdb/testsuite/gdb.base/volatile.exp 2004-01-06 14:05:14.000000000 -0500
--- gdb.base/volatile.exp 2004-01-07 16:50:05.000000000 -0500
*************** if [get_compiler_info ${binfile}] {
*** 55,74 ****
return -1;
}
! if {$hp_aCC_compiler || $hp_cc_compiler} {
! set lang "c++"
! } else {
! set lang ""
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug $lang]] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
- if [get_compiler_info ${binfile}] {
- return -1
- }
-
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
--- 55,64 ----
return -1;
}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug ] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
*************** proc local_compiler_xfail_check { } {
*** 91,96 ****
--- 81,91 ----
setup_xfail "*-*-*"
}
}
+
+ global hp_cc_compiler
+ if { $hp_cc_compiler } {
+ setup_xfail "hppa*-*-hpux*"
+ }
}
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"