From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1596 invoked by alias); 7 Jan 2004 22:38:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1559 invoked from network); 7 Jan 2004 22:38:19 -0000 Received: from unknown (HELO tisch.mail.mindspring.net) (207.69.200.157) by sources.redhat.com with SMTP; 7 Jan 2004 22:38:19 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by tisch.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1AeMJf-0005aM-00 for gdb-patches@sources.redhat.com; Wed, 07 Jan 2004 17:38:19 -0500 Received: by berman.michael-chastain.com (Postfix, from userid 502) id B6ED24B35A; Wed, 7 Jan 2004 17:38:49 -0500 (EST) To: gdb-patches@sources.redhat.com Subject: [rfa/testsuite] constvars.exp, volatile.exp: hp-ux Message-Id: <20040107223849.B6ED24B35A@berman.michael-chastain.com> Date: Wed, 07 Jan 2004 22:38:00 -0000 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) X-SW-Source: 2004-01/txt/msg00179.txt.bz2 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 * 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 $"