This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa/testsuite/stabs] weird.exp: skip hp


This patch fixes weird.exp so that it skips properly on hp-ux.

The old code looked at the CC environment variable.  The new code looks
at hp_cc_compiler and hp_aCC_compiler.

This isn't perfect, because we really want to test for the HP assembler,
not the HP compiler.  If someone is using an HP compiler then of course
they are using the HP assembler.  But if someone is using gcc with the
HP assembler (which is not recommended on hp-ux), then the test script
is going to execute.

If I detect hp_cc_compiler or hp_aCC_compiler, I issue one UNSUPPORTED
message and skip the test script.

I also fixed the copyright years by adding years where patches were
committed to this file on cvs HEAD.  I could do this as a separate
patch if you want.

Tested on:

  native i686-pc-linux-gnu, gcc 2.95.3 3.3.2 HEAD, dwarf-2 and stabs+
  native hppa2.0w-hp-hpux11.11, hp ansi c

Okay to commit?

Michael C

2004-01-07  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.stabs/weird.exp: Use hp_cc_compiler and hp_aCC_compiler
	to test for hp-ux assembler.  Fix copyright years.

Index: gdb.stabs/weird.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.stabs/weird.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 weird.exp
*** gdb.stabs/weird.exp	11 Sep 2003 19:09:46 -0000	1.6
--- gdb.stabs/weird.exp	7 Jan 2004 21:18:43 -0000
***************
*** 1,4 ****
! #   Copyright 1997, 1998, 1999 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
--- 1,5 ----
! # Copyright 1997, 1998, 1999, 2001, 2003, 2004
! # 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
*************** if ![file isdirectory ${objdir}/${subdir
*** 33,38 ****
--- 34,57 ----
  set prms_id 0
  set bug_id 0
  
+ set testfile weird
+ set srcfile ${objdir}/${subdir}/weird.s
+ set binfile ${objdir}/${subdir}/weirdx.o
+ 
+ if { [ get_compiler_info "$binfile" ] } {
+     return -1
+ }
+ 
+ if { $hp_cc_compiler || $hp_aCC_compiler } {
+     # The native hp-ux assembler does not support stabs at all.
+     # If the compiler is native hp-ux, of course the assembler is too.
+     # But if someone builds gcc with the native assembler (not recommended)
+     # rather than the gnu assembler, then this logic will not suppress it.
+     # -- chastain 2004-01-07
+     unsupported "stabs with HP assembler"
+     continue
+ }
+ 
  proc do_tests {} {
  	global binfile
  	global gdb_prompt
*************** proc print_weird_var { var } {
*** 236,244 ****
  
  # Don't use gdb_load; it doesn't bitch if the loading produced some
  # error messages during symbol reading.
- set testfile weird
- set srcfile ${objdir}/${subdir}/weird.s
- set binfile ${objdir}/${subdir}/weirdx.o
  
  global target_os
  set sedscript ${srcdir}/${subdir}/aout.sed
--- 255,260 ----
*************** switch -glob ${target_triplet} {
*** 266,284 ****
      }
  }
  
- 
  # Hope this is a Unix box.
  set exec_output [remote_exec build "sed" "-f ${sedscript}" "${srcdir}/${subdir}/weird.def" "${srcfile}"]
  if { [lindex $exec_output 0] != 0 } {
      perror "Couldn't make test case. $exec_output"
      return -1
  }
- 
- # HP's assembler has no idea of what to do with .stab directives; detect the
- # use of HP compilers and escape from here.  (No doubt a better heuristic
- # could be devised.)
- 
- if { [ info exists CC ] && [ string first "/opt/ansic/bin/cc" "$CC" ] >= 0 } then { continue }
  
  if  { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
--- 282,293 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]