Handle void * conversions in FreeBSD/x86 native code to fix C++ build.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / ctti.exp
index 4ee738c63dd1ca31252d31b277146d3fb2423a49..0d1c43b41f600a4accb3b9fa70158915cc9e3b58 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 1998, 1999, 2001, 2003, 2004, 2007, 2008
-# Free Software Foundation, Inc.
+# Copyright 1998-2016 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
 
 # Call to template instantiations.
 
-if $tracelevel then {
-    strace $tracelevel
-}
-
 if { [skip_cplus_tests] } { continue }
 
-set testfile "cttiadd"
-set srcfile  "${testfile}.cc"
-set srcfile1 "${testfile}1.cc"
-set srcfile2 "${testfile}2.cc"
-set srcfile3 "${testfile}3.cc"
-set objfile  "${testfile}.o"
-set objfile1 "${testfile}1.o"
-set objfile2 "${testfile}2.o"
-set objfile3 "${testfile}3.o"
-set binfile  "${objdir}/${subdir}/${testfile}"
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile" "$objdir/$subdir/$objfile" object {debug c++}] != "" } {
-     untested ctti.exp
-     return -1
-}
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
-     untested ctti.exp
-     return -1
-}
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
-     untested ctti.exp
-     return -1
-}
+standard_testfile cttiadd.cc cttiadd1.cc cttiadd2.cc cttiadd3.cc
 
-if { [gdb_compile "$srcdir/$subdir/$srcfile3" "$objdir/$subdir/$objfile3" object {debug c++}] != "" } {
-     untested ctti.exp
-     return -1
+if [get_compiler_info "c++"] {
+    return -1
 }
 
-if { [gdb_compile "$objdir/$subdir/$objfile $objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2 $objdir/$subdir/$objfile3" "${binfile}" executable {debug c++}] != "" } {
-     untested ctti.exp
-     return -1
+if {[prepare_for_testing $testfile.exp $testfile \
+        [list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
+    return -1
 }
 
-if [get_compiler_info ${binfile} "c++"] {
-    return -1;
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
@@ -112,7 +73,7 @@ gdb_test_multiple "print add<float>(2.25,2.25)" "print add<float>(2.25,2.25)" {
 }
 
 gdb_test_multiple "print add<unsigned char>('A','A')" "print add<unsigned char>('A','A')" {
-    -re "\\$\[0-9\]+ = -126 .*\r\n$gdb_prompt $" {
+    -re "\\$\[0-9\]+ = 130 .*\r\n$gdb_prompt $" {
        pass "print add<unsigned char>('A','A')"
     }
     -re "No symbol \"add<unsigned char>\" in current context.\r\n$gdb_prompt $" {
@@ -142,7 +103,7 @@ gdb_test_multiple "print add2<float>(2.25,2.25)" "print add2<float>(2.25,2.25)"
 }
 
 gdb_test_multiple "print add2<unsigned char>('A','A')" "print add2<unsigned char>('A','A')" {
-    -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
+    -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
        pass "print add2<unsigned char>('A','A')"
     }
     -re "No symbol \"add2<unsigned char>\" in current context.\r\n$gdb_prompt $" {
@@ -172,7 +133,7 @@ gdb_test_multiple "print add3<float>(2.25,2.25)" "print add3<float>(2.25,2.25)"
 }
 
 gdb_test_multiple "print add3<unsigned char>('A','A')" "print add3<unsigned char>('A','A')" {
-    -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
+    -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
        pass "print add3<unsigned char>('A','A')"
     }
     -re "No symbol \"add3<unsigned char>\" in current context.\r\n$gdb_prompt $" {
@@ -202,7 +163,7 @@ gdb_test_multiple "print add4<float>(2.25,2.25)" "print add4<float>(2.25,2.25)"
 }
 
 gdb_test_multiple "print add4<unsigned char>('A','A')" "print add4<unsigned char>('A','A')" {
-    -re "\\$\[0-9]+ = -126 .*$gdb_prompt $" {
+    -re "\\$\[0-9]+ = 130 .*$gdb_prompt $" {
        pass "print add4<unsigned char>('A','A')"
     }
     -re "No symbol \"add4<unsigned char>\" in current context.\r\n$gdb_prompt $" {
This page took 0.027042 seconds and 4 git commands to generate.