OSDN Git Service

Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / lib / libstdc++.exp
index 136c2f7..3adf91c 100644 (file)
@@ -1,11 +1,11 @@
 # libstdc++ "tool init file" for DejaGNU
 
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 # 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 # 
 # This program is distributed in the hope that it will be useful,
@@ -14,9 +14,8 @@
 # GNU General Public License for more details.
 # 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
 
 
 # Define callbacks and load other libraries.  This file is loaded relatively
@@ -53,6 +52,8 @@ load_gcc_lib target-supports-dg.exp
 load_lib prune.exp
 load_lib dg-options.exp
 load_gcc_lib target-libpath.exp
+load_gcc_lib timeout.exp
+load_gcc_lib timeout-dg.exp
 load_gcc_lib wrapper.exp
 
 # Useful for debugging.  Pass the name of a variable and the verbosity
@@ -81,14 +82,15 @@ proc v3-copy-files {srcfiles} {
 # Called once, during runtest.exp setup.
 proc libstdc++_init { testfile } {
     global env
-    global v3-sharedlib 
+    global v3-sharedlib v3-libgomp
     global srcdir blddir objdir tool_root_dir
-    global cc cxx cxxflags cxxldflags
+    global cc cxx cxxflags cxxpchflags cxxldflags
     global includes
     global gluefile wrap_flags
     global ld_library_path
     global target_triplet
     global flags_file
+    global tool_timeout
 
     # We set LC_ALL and LANG to C so that we get the same error
     # messages as expected.
@@ -123,15 +125,29 @@ proc libstdc++_init { testfile } {
     v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"]
     v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"]
 
+    set ld_library_path_tmp ""
+
     # Locate libgcc.a so we don't need to account for different values of
     # SHLIB_EXT on different platforms
     set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
     if {$gccdir != ""} {
         set gccdir [file dirname $gccdir]
+       append ld_library_path_tmp ":${gccdir}"
     }
     v3track gccdir 3
 
-    # Look for shared library. (ie libstdc++.so.)
+    # Locate libgomp. This is only required for parallel mode.
+    set v3-libgomp 0
+    set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so]
+    if {$libgompdir != ""} {
+       set v3-libgomp 1
+        set libgompdir [file dirname $libgompdir]
+       append ld_library_path_tmp ":${libgompdir}"
+       verbose -log "libgomp support detected"
+    }
+    v3track libgompdir 3
+
+    # Locate libstdc++ shared library. (ie libstdc++.so.)
     set v3-sharedlib 0
     set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.so]
     if {$sharedlibdir != ""} {
@@ -144,9 +160,8 @@ proc libstdc++_init { testfile } {
 
     # Compute what needs to be added to the existing LD_LIBRARY_PATH.
     if {$gccdir != ""} {
-       set ld_library_path ""
-       append ld_library_path ":${gccdir}"
        set compiler ${gccdir}/g++
+       set ld_library_path ${ld_library_path_tmp}
        append ld_library_path ":${blddir}/src/.libs"
 
        if { [is_remote host] == 0 && [which $compiler] != 0 } {
@@ -171,9 +186,13 @@ proc libstdc++_init { testfile } {
        set compiler [transform "g++"]
     }
 
+    # Set the default timeout for v3 tests.
+    set tool_timeout 600
+
     # Default settings.
     set cxx [transform "g++"]
     set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
+    set cxxpchflags ""
     set cxxldflags ""
     set cc [transform "gcc"]
     # Locate testsuite_hooks.h and other testsuite headers.
@@ -211,6 +230,7 @@ proc libstdc++_init { testfile } {
         # If we find a testsuite_flags file, we're testing in the build dir.
        set cxx [exec sh $flags_file --build-cxx]
        set cxxflags [exec sh $flags_file --cxxflags]
+       set cxxpchflags [exec sh $flags_file --cxxpchflags]
        set cxxldflags [exec sh $flags_file --cxxldflags]
        set cc [exec sh $flags_file --build-cc]
        set includes [exec sh $flags_file --build-includes]
@@ -227,23 +247,29 @@ proc libstdc++_init { testfile } {
     # this check until $cxx and such have been initialized because we
     # perform a test compilation.  (Ideally, gcc --print-file-name would
     # list PCH files, but it does not.)
-    global PCH_CXXFLAGS
-    if ![info exists PCH_CXXFLAGS] then {
+    if { $cxxpchflags != "" } {
        set src "config[pid].cc"
        set f [open $src "w"]
        puts $f "int main () {}"
        close $f
 
+       # Fixme: "additional_flags=$cxxpchflags" fails, but would be
+       # useful as then the requested variant of the pre-build PCH
+       # files could be tested to see if it works.
        set lines [v3_target_compile $src "config[pid].o" object \
-                "additional_flags=-include additional_flags=bits/stdtr1c++.h"]
-       if {$lines == "" } {
-#          set PCH_CXXFLAGS "-include bits/extc++.h"
-#          set PCH_CXXFLAGS "-include bits/stdtr1c++.h"
-           set PCH_CXXFLAGS "-include bits/stdc++.h"
-       } else {
-           set PCH_CXXFLAGS ""
-       }
+                  "additional_flags=-include additional_flags=bits/stdc++.h"]
+       if { $lines != "" } {
+           verbose -log "Requested PCH file: $cxxpchflags"
+           verbose -log "is not working, and will not be used."
+           set cxxpchflags ""
+       } 
        file delete $src
+     } 
+    v3track cxxpchflags 2
+
+    global PCH_CXXFLAGS
+    if ![info exists PCH_CXXFLAGS] then {
+       set PCH_CXXFLAGS $cxxpchflags
        v3track PCH_CXXFLAGS 2
     }
 
@@ -325,6 +351,24 @@ proc libstdc++-dg-test { prog do_what extra_tool_flags } {
     return [list $comp_output $output_file]
 }
 
+# Override the DejaGnu dg-test in order to clear flags after a test, as
+# is done for compiler tests in gcc-dg.exp.
+
+if { [info procs saved-dg-test] == [list] } {
+    rename dg-test saved-dg-test
+
+    proc dg-test { args } {
+       global errorInfo
+
+       if { [ catch { eval saved-dg-test $args } errmsg ] } {
+           set saved_info $errorInfo
+           unset_timeout_vars
+           error $errmsg $saved_info
+       }
+       unset_timeout_vars
+    }
+}
+
 # True if the library supports wchar_t.
 set v3-wchar_t 0
 
@@ -368,7 +412,7 @@ proc v3_target_compile { source dest type options } {
     }
 
     lappend options "compiler=$cxx_final"
-    lappend options "timeout=600"
+    lappend options "timeout=[timeout_value]"
 
     return [target_compile $source $dest $type $options]
 }
@@ -425,15 +469,16 @@ proc v3_target_compile_as_c { source dest type options } {
        set includestarget "${includesbase}/${machine}"
        set cc_final [concat $cc_final "-I$includesbase -I$includestarget"]
 
-        set libsup "${comp_base_dir}/lib"
+        set libdir "-L${comp_base_dir}/lib"
     } else {
-        set libsup "${blddir}/libsupc++/.libs"
+        set libdir "-L${blddir}/libsupc++/.libs"
+       set libdir [concat $libdir "-L${blddir}/src/.libs"]
     }
 
-    set cc_final [concat $cc_final "-L$libsup"]
+    set cc_final [concat $cc_final "$libdir"]
 
     lappend options "compiler=$cc_final"
-    lappend options "timeout=600"
+    lappend options "timeout=[timeout_value]"
 
     return [target_compile $source $dest $type $options]
 }
@@ -494,7 +539,7 @@ proc v3-build_support { } {
     # Build the support objects.
     set source_files [list testsuite_abi.cc testsuite_allocator.cc \
                          testsuite_character.cc testsuite_hooks.cc \
-                rng/twister_rand_gen.cc io/verified_cmd_line_input.cc \
+                         io/verified_cmd_line_input.cc \
                          io/prog_bar.cc performance/time/elapsed_timer.cc ]
     foreach f $source_files {
        set obj [file rootname $f].o
@@ -589,15 +634,20 @@ proc check_v3_target_fileio { } {
        puts $f "int main ()"
        puts $f "{"
        puts $f "  int fd  = open (\".\", O_RDONLY);"
+       puts $f "  int ret = 0;"
        puts $f "  if (fd == -1)"
        puts $f "  {"
        puts $f "    int err = errno;"
        puts $f "    if (err == EIO || err == ENOSYS)"
-       puts $f "      return 1;"
+       puts $f "      ret = 1;"
        puts $f "  }"
        puts $f "  else"
+       puts $f "  {"
+       puts $f "    if (lseek (fd, 0, SEEK_CUR) == -1)"
+       puts $f "      ret = 1;"
        puts $f "    close (fd);"
-       puts $f "  return 0;"
+       puts $f "  }"
+       puts $f "  return ret;"
        puts $f "}" 
        close $f
 
@@ -663,7 +713,7 @@ proc check_v3_target_c_std { } {
        puts $f "  int i = std::tr1::isnan(f);"
        puts $f "  "
        puts $f "  using std::wctomb;"
-       puts $f "  return 0;"
+       puts $f "  return i;"
        puts $f "}" 
        close $f
 
@@ -747,6 +797,61 @@ proc check_v3_target_time { } {
     return $et_time_saved
 }
 
+proc check_v3_target_rvalref { } {
+    global et_rvalref_saved
+    global et_rvalref_target_name
+    global tool        
+
+    if { ![info exists et_rvalref_target_name] } {
+       set et_rvalref_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_rvalref_target_name } {
+       verbose "check_v3_target_rvalref: `$et_rvalref_target_name'" 2
+       set et_rvalref_target_name $current_target
+       if [info exists et_rvalref_saved] {
+           verbose "check_v3_target_rvalref: removing cached result" 2
+           unset et_rvalref_saved
+       }
+    }
+
+    if [info exists et_rvalref_saved] {
+       verbose "check_v3_target_rvalref: using cached result" 2
+    } else {
+       set et_rvalref_saved 0
+
+       # Set up and compile a C++ test program that tries to use
+       # the library components of rval references
+       set src rvalref[pid].cc
+       set exe rvalref[pid].x
+
+       set f [open $src "w"]
+       puts $f "#include <iterator>"
+       puts $f "#include <utility>"
+       puts $f "using std::move;"
+       puts $f "using std::identity;"
+       puts $f "using std::forward;"
+       puts $f "using std::move_iterator;"
+       puts $f "using std::make_move_iterator;"
+       close $f
+
+       set lines [v3_target_compile $src $exe executable ""]
+       file delete $src
+
+       if [string match "" $lines] {
+           # No error message, compilation succeeded.
+           verbose "check_v3_target_rvalref: compilation succeeded" 2
+           remote_file build delete $exe
+           set et_rvalref_saved 1
+       } else {
+           verbose "check_v3_target_rvalref: compilation failed" 2
+       }
+    }
+    return $et_rvalref_saved
+}
+
 proc check_v3_target_namedlocale { } {
     global et_namedlocale_saved
     global et_namedlocale_target_name
@@ -860,7 +965,7 @@ proc check_v3_target_debug_mode { } {
     } else {
        set et_debug_mode 0
 
-       # Set up, compile, and execute a C++ test program that depends
+       # Set up and compile a C++ test program that depends
        # on debug mode working.
        set src debug_mode[pid].cc
        set exe debug_mode[pid].exe
@@ -889,7 +994,7 @@ proc check_v3_target_debug_mode { } {
 
 proc check_v3_target_parallel_mode { } {
     global cxxflags
-    global DEFAULT_CXXFLAGS
+    global v3-libgomp
     global et_parallel_mode
 
     global tool        
@@ -914,15 +1019,53 @@ proc check_v3_target_parallel_mode { } {
     } else {
        set et_parallel_mode 0
 
-       # Set up, compile, and execute a C++ test program that depends
-       # on parallel mode working.
-       set src parallel_mode[pid].cc
-       set exe parallel_mode[pid].exe
+       # If 'make check-parallel' is running the test succeeds.
+       if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } {
+           set et_parallel_mode 1
+       }
+    }
+    verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2
+    return $et_parallel_mode
+}
+
+proc check_v3_target_cstdint { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_cstdint
+
+    global tool        
+
+    if { ![info exists et_cstdint_target_name] } {
+       set et_cstdint_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_cstdint_target_name } {
+       verbose "check_v3_target_cstdint: `$et_cstdint_target_name'" 2
+       set et_cstdint_target_name $current_target
+       if [info exists et_cstdint] {
+           verbose "check_v3_target_cstdint: removing cached result" 2
+           unset et_cstdint
+       }
+    }
+
+    if [info exists et_cstdint] {
+       verbose "check_v3_target_cstdint: using cached result" 2
+    } else {
+       set et_cstdint 0
+
+       # Set up and compile a C++0x test program that depends
+       # on the C99 stdint facilities to be available.
+       set src cstdint[pid].cc
+       set exe cstdint[pid].exe
 
        set f [open $src "w"]
-       puts $f "#include <omp.h>"
+       puts $f "#include <tr1/cstdint>"
        puts $f "int main()"
+       puts $f "#ifdef _GLIBCXX_USE_C99_STDINT_TR1"
        puts $f "{ return 0; }"
+       puts $f "#endif"
        close $f
 
        set cxxflags_saved $cxxflags
@@ -934,11 +1077,301 @@ proc check_v3_target_parallel_mode { } {
 
        if [string match "" $lines] {
            # No error message, compilation succeeded.
-           set et_parallel_mode 1
+           set et_cstdint 1
        } else {
-           verbose "check_v3_target_parallel_mode: compilation failed" 2
+           verbose "check_v3_target_cstdint: compilation failed" 2
        }
     }
-    verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2
-    return $et_parallel_mode
+    verbose "check_v3_target_cstdint: $et_cstdint" 2
+    return $et_cstdint
+}
+
+proc check_v3_target_atomic_builtins { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_cstdint
+
+    global tool        
+
+    if { ![info exists et_atomic_builtins_target_name] } {
+       set et_atomic_builtins_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_atomic_builtins_target_name } {
+       verbose "check_v3_target_atomic_builtins: `$et_atomic_builtins_target_name'" 2
+       set et_atomic_builtins_target_name $current_target
+       if [info exists et_atomic_builtins] {
+           verbose "check_v3_target_atomic_builtins: removing cached result" 2
+           unset et_atomic_builtins
+       }
+    }
+
+    if [info exists et_atomic_builtins] {
+       verbose "check_v3_target_atomic_builtins: using cached result" 2
+    } else {
+       set et_atomic_builtins 0
+
+       # Set up and compile a C++0x test program that depends
+       # on the atomic builtin facilities to be available.
+       set src atomic_builtins[pid].cc
+       set exe atomic_builtins[pid].exe
+
+       set f [open $src "w"]
+       puts $f "#include <bits/c++config.h>"
+       puts $f "int main()"
+       puts $f "#ifdef _GLIBCXX_ATOMIC_BUILTINS_4"
+       puts $f "{ return 0; }"
+       puts $f "#endif"
+       close $f
+
+       set cxxflags_saved $cxxflags
+       set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+       set lines [v3_target_compile $src $exe executable ""]
+       set cxxflags $cxxflags_saved
+       file delete $src
+
+       if [string match "" $lines] {
+           # No error message, compilation succeeded.
+           set et_atomic_builtins 1
+       } else {
+           verbose "check_v3_target_atomic_builtins: compilation failed" 2
+       }
+    }
+    verbose "check_v3_target_atomic_builtins: $et_atomic_builtins" 2
+    return $et_atomic_builtins
+}
+
+proc check_v3_target_gthreads { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_gthreads
+
+    global tool
+
+    if { ![info exists et_gthreads_target_name] } {
+        set et_gthreads_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_gthreads_target_name } {
+        verbose "check_v3_target_gthreads: `$et_gthreads_target_name'" 2
+        set et_gthreads_target_name $current_target
+        if [info exists et_gthreads] {
+            verbose "check_v3_target_gthreads: removing cached result" 2
+            unset et_gthreads
+        }
+    }
+
+    if [info exists et_gthreads] {
+        verbose "check_v3_target_gthreads: using cached result" 2
+    } else {
+        set et_gthreads 0
+
+        # Set up and compile a C++0x test program that depends
+        # on the gthreads facilities to be available.
+        set src gthreads[pid].cc
+        set exe gthreads[pid].exe
+
+        set f [open $src "w"]
+       puts $f "#include <bits/c++config.h>"
+        puts $f "int main()"
+        puts $f "#ifdef _GLIBCXX_HAS_GTHREADS"
+        puts $f "{ return 0; }"
+        puts $f "#endif"
+        close $f
+
+        set cxxflags_saved $cxxflags
+        set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+        set lines [v3_target_compile $src $exe executable ""]
+        set cxxflags $cxxflags_saved
+        file delete $src
+
+        if [string match "" $lines] {
+            # No error message, compilation succeeded.
+            set et_gthreads 1
+        } else {
+            verbose "check_v3_target_gthreads: compilation failed" 2
+        }
+    }
+    verbose "check_v3_target_gthreads: $et_gthreads" 2
+    return $et_gthreads
+}
+
+proc check_v3_target_nanosleep { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_nanosleep
+
+    global tool
+
+    if { ![info exists et_nanosleep_target_name] } {
+        set et_nanosleep_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_nanosleep_target_name } {
+        verbose "check_v3_target_nanosleep: `$et_nanosleep_target_name'" 2
+        set et_nanosleep_target_name $current_target
+        if [info exists et_nanosleep] {
+            verbose "check_v3_target_nanosleep: removing cached result" 2
+            unset et_nanosleep
+        }
+    }
+
+    if [info exists et_nanosleep] {
+        verbose "check_v3_target_nanosleep: using cached result" 2
+    } else {
+        set et_nanosleep 0
+       
+       # Set up and compile a C++0x test program that depends
+        # on the nanosleep facilities to be available.
+        set src nanosleep[pid].cc
+        set exe nanosleep[pid].exe
+
+        set f [open $src "w"]
+        puts $f "#include <bits/c++config.h>"
+        puts $f "int main()"
+        puts $f "#ifdef _GLIBCXX_USE_NANOSLEEP"
+        puts $f "{ return 0; }"
+        puts $f "#endif"
+        close $f
+
+        set cxxflags_saved $cxxflags
+        set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+        set lines [v3_target_compile $src $exe executable ""]
+        set cxxflags $cxxflags_saved
+        file delete $src
+
+        if [string match "" $lines] {
+            # No error message, compilation succeeded.
+            set et_nanosleep 1
+        } else {
+            verbose "check_v3_target_nanosleep: compilation failed" 2
+        }
+    }
+    verbose "check_v3_target_nanosleep: $et_nanosleep" 2
+    return $et_nanosleep
+}
+
+proc check_v3_target_sched_yield { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_sched_yield
+
+    global tool
+
+    if { ![info exists et_sched_yield_target_name] } {
+        set et_sched_yield_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_sched_yield_target_name } {
+        verbose "check_v3_target_sched_yield: `$et_sched_yield_target_name'" 2
+        set et_sched_yield_target_name $current_target
+        if [info exists et_sched_yield] {
+            verbose "check_v3_target_sched_yield: removing cached result" 2
+            unset et_sched_yield
+        }
+    }
+
+    if [info exists et_sched_yield] {
+        verbose "check_v3_target_sched_yield: using cached result" 2
+    } else {
+        set et_sched_yield 0
+
+        # Set up and compile a C++0x test program that depends
+        # on the sched_yield facility to be available.
+        set src sched_yield[pid].cc
+        set exe sched_yield[pid].exe
+
+        set f [open $src "w"]
+        puts $f "#include <bits/c++config.h>"
+        puts $f "int main()"
+        puts $f "#ifdef _GLIBCXX_USE_SCHED_YIELD"
+        puts $f "{ return 0; }"
+        puts $f "#endif"
+        close $f
+
+        set cxxflags_saved $cxxflags
+        set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+        set lines [v3_target_compile $src $exe executable ""]
+        set cxxflags $cxxflags_saved
+        file delete $src
+
+        if [string match "" $lines] {
+            # No error message, compilation succeeded.
+            set et_sched_yield 1
+        } else {
+            verbose "check_v3_target_sched_yield: compilation failed" 2
+        }
+    }
+    verbose "check_v3_target_sched_yield: $et_sched_yield" 2
+    return $et_sched_yield
+}
+
+proc check_v3_target_string_conversions { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_string_conversions
+
+    global tool
+
+    if { ![info exists et_string_conversions_target_name] } {
+        set et_string_conversions_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_string_conversions_target_name } {
+        verbose "check_v3_target_string_conversions: `$et_string_conversions_target_name'" 2
+        set et_string_conversions_target_name $current_target
+        if [info exists et_string_conversions] {
+            verbose "check_v3_target_string_conversions: removing cached result" 2
+            unset et_string_conversions
+        }
+    }
+
+    if [info exists et_string_conversions] {
+        verbose "check_v3_target_string_conversions: using cached result" 2
+    } else {
+        set et_string_conversions 0
+       
+       # Set up and compile a C++0x test program that depends
+        # on the string_conversions facilities to be available.
+        set src string_conversions[pid].cc
+        set exe string_conversions[pid].exe
+
+        set f [open $src "w"]
+        puts $f "#include <bits/c++config.h>"
+        puts $f "int main()"
+        puts $f "#if defined(_GLIBCXX_USE_C99) && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)"
+        puts $f "{ return 0; }"
+        puts $f "#endif"
+        close $f
+
+        set cxxflags_saved $cxxflags
+        set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+        set lines [v3_target_compile $src $exe executable ""]
+        set cxxflags $cxxflags_saved
+        file delete $src
+
+        if [string match "" $lines] {
+            # No error message, compilation succeeded.
+            set et_string_conversions 1
+        } else {
+            verbose "check_v3_target_string_conversions: compilation failed" 2
+        }
+    }
+    verbose "check_v3_target_string_conversions: $et_string_conversions" 2
+    return $et_string_conversions
 }