[patch/testsuite/c++] migrate gcc_compiled to test_compiler_info

Michael Elizabeth Chastain mec.gnu@mindspring.com
Sun Nov 23 18:20:00 GMT 2003


This patch changes gdb.cp/*.exp to use the new 'test_compiler_info'
instead of the old 'gcc_compiled'.  I like 'test_compiler_info'
because it is a function.

Also, 'gcc_compiled' sorta implies that there is something special about
gcc (which is meh), but 'test_compiler_info' implies that gdb is always
sensitive to the compiler used (which is more accurate).

Testing: I ran this through my testbed with gcc 2 and gcc 3,
dwarf-2 and stabs+.  But I don't have any non-gcc compilers.

I am committing this now.

Michael C

2003-11-23  Michael Chastain  <mec@shout.net>

	Partial fix for PR testsuite/1456.
	* gdb.cp/ambiguous.exp: Replace reference to gcc_compiled with
	call to test_compiler_info.
	* gdb.cp/ctti.exp: Likewise.
	* gdb.cp/derivation.exp: Likewise.
	* gdb.cp/member-ptr.exp: Likewise.
	* gdb.cp/virtfunc.exp (test_virtual_calls): Remove unused
	reference to gcc_compiled.

Index: gdb.cp/ambiguous.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ambiguous.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ambiguous.exp
*** gdb.cp/ambiguous.exp	23 Aug 2003 03:55:59 -0000	1.1
--- gdb.cp/ambiguous.exp	23 Nov 2003 18:11:40 -0000
***************
*** 1,4 ****
! # Copyright 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,4 ----
! # Copyright 1998, 1999, 2003 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 [get_compiler_info ${binfile} "c++"] 
*** 45,51 ****
      return -1;
  }
  
! if { $gcc_compiled } then { continue }
  
  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."
--- 45,51 ----
      return -1;
  }
  
! if { [test_compiler_info gcc-*] } then { continue }
  
  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."
Index: gdb.cp/ctti.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ctti.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ctti.exp
*** gdb.cp/ctti.exp	23 Aug 2003 03:55:59 -0000	1.1
--- gdb.cp/ctti.exp	23 Nov 2003 18:11:40 -0000
***************
*** 1,4 ****
! # Copyright 1998, 1999, 2001 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,4 ----
! # Copyright 1998, 1999, 2001, 2003 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 [get_compiler_info ${binfile} "c++"] 
*** 46,52 ****
      return -1;
  }
  
! if { $gcc_compiled } then { continue }
  
  #if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } {
  #     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
--- 46,52 ----
      return -1;
  }
  
! if { [test_compiler_info gcc-*] } then { continue }
  
  #if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } {
  #     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
Index: gdb.cp/derivation.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/derivation.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 derivation.exp
*** gdb.cp/derivation.exp	23 Aug 2003 03:55:59 -0000	1.1
--- gdb.cp/derivation.exp	23 Nov 2003 18:11:40 -0000
***************
*** 1,4 ****
! # Copyright 1998, 1999, 2000, 2001, 2002 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,4 ----
! # Copyright 1998, 1999, 2000, 2001, 2002, 2003 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
*************** gdb_expect {
*** 109,115 ****
      timeout           { fail "(timeout) print value of d_instance" }
    }
  
!   if {$gcc_compiled} then {
        send_gdb "ptype d_instance\n"
        gdb_expect {
  	  -re "type = class D : private A, public B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t ]+D & operator=\\(D const ?&\\);\[\r\n\t ]+D\\((D const|const D) ?&\\);\[\r\n\t \]+D\\((void|)\\);\r\n\[\t \]*int dfoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $"  { pass "ptype d_instance" }
--- 109,115 ----
      timeout           { fail "(timeout) print value of d_instance" }
    }
  
!   if { [test_compiler_info gcc-*] } then {
        send_gdb "ptype d_instance\n"
        gdb_expect {
  	  -re "type = class D : private A, public B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t ]+D & operator=\\(D const ?&\\);\[\r\n\t ]+D\\((D const|const D) ?&\\);\[\r\n\t \]+D\\((void|)\\);\r\n\[\t \]*int dfoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $"  { pass "ptype d_instance" }
*************** gdb_expect {
*** 140,146 ****
      timeout           { fail "(timeout) print value of e_instance" }
    }
  
!   if {$gcc_compiled} {
        send_gdb "ptype e_instance\n"
        gdb_expect {
  	  -re "type = class E : public A, private B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t ]+E & operator=\\(E const ?&\\);\[\r\n\t ]+E\\((E const|const E) ?&\\);\[\r\n\t \]+E\\((void|)\\);\r\n\[\t \]*int efoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $"  { pass "ptype e_instance" }
--- 140,146 ----
      timeout           { fail "(timeout) print value of e_instance" }
    }
  
!   if { [test_compiler_info gcc-*] } then {
        send_gdb "ptype e_instance\n"
        gdb_expect {
  	  -re "type = class E : public A, private B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t ]+E & operator=\\(E const ?&\\);\[\r\n\t ]+E\\((E const|const E) ?&\\);\[\r\n\t \]+E\\((void|)\\);\r\n\[\t \]*int efoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $"  { pass "ptype e_instance" }
Index: gdb.cp/member-ptr.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/member-ptr.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 member-ptr.exp
*** gdb.cp/member-ptr.exp	23 Aug 2003 03:55:59 -0000	1.1
--- gdb.cp/member-ptr.exp	23 Nov 2003 18:11:41 -0000
***************
*** 1,4 ****
! # Copyright 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,4 ----
! # Copyright 1998, 1999, 2003 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 [get_compiler_info ${binfile} "c++"] 
*** 54,60 ****
  # Nearly all of these tests fail when compiled with G++, so just give up
  # until GDB gets enhanced. -sts 1999-06-22
  
! if {$gcc_compiled} {
      continue 
  }
  
--- 54,60 ----
  # Nearly all of these tests fail when compiled with G++, so just give up
  # until GDB gets enhanced. -sts 1999-06-22
  
! if { [test_compiler_info gcc-*] } then {
      continue 
  }
  
Index: gdb.cp/virtfunc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/virtfunc.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 virtfunc.exp
*** gdb.cp/virtfunc.exp	23 Aug 2003 03:55:59 -0000	1.1
--- gdb.cp/virtfunc.exp	23 Nov 2003 18:11:42 -0000
*************** proc test_virtual_calls {} {
*** 734,740 ****
      global gdb_prompt
      global GDB
      global nl
-     global gcc_compiled
  
      if [target_info exists gdb,cannot_call_functions] {
  	setup_xfail "*-*-*" 2416
--- 734,739 ----



More information about the Gdb-patches mailing list