This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

PATCH: PR testsuite/35558: Untested g++.dg/tls/static-1a.cc


Hi,

dg-additional-files is called when compiling source code if there is

{ dg-additional-sources "static-1a.cc" }

check_runtime_nocache is called when there is

{ dg-require-effective-target tls_runtime }

When both are in the same test source file, we will do run time
check with additional sources, which don't exist in the same
directory where the run time check source is, and the run time
check will fail. However, those additional sources aren't needed
for run time check.

This patch avoids adding those additional sources for run-time
check. OK to install if pass on Linux/Intel64?


H.J.
2008-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/35558
	* lib/gcc-defs.exp (dg-additional-files): Don't add additional
	source files for run time check.

	* lib/target-supports.exp (check_runtime_nocache): Set
	do_check_runtime during run time check.

Index: gcc/testsuite/lib/gcc-defs.exp
===================================================================
--- gcc/testsuite/lib/gcc-defs.exp	(revision 1818)
+++ gcc/testsuite/lib/gcc-defs.exp	(working copy)
@@ -199,6 +199,13 @@ proc dg-additional-files { args } {
 proc dg-additional-files-options { options source } {
     global additional_sources
     global additional_files
+    global do_check_runtime
+
+    # Don't add additional source files for run time check.
+    if { [info exists do_check_runtime ] && $do_check_runtime == 1 } {
+	return ""
+    }
+
     set to_download [list]
     if { $additional_sources != "" } then {
 	if [is_remote host] {
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 1818)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -163,7 +163,12 @@ proc check_no_messages_and_pattern {prop
 # TYPE implicitly being "executable".
 proc check_runtime_nocache {basename contents args} {
     global tool
+    global source
+    global do_check_runtime
 
+    # Inform dg-additional-files-options that it is a runtime check,
+    # not a real test.
+    set do_check_runtime 1
     set result [eval [list check_compile $basename executable $contents] $args]
     set lines [lindex $result 0]
     set output [lindex $result 1]
@@ -179,6 +184,7 @@ proc check_runtime_nocache {basename con
 	}
     }
     remote_file build delete $output
+    set do_check_runtime 0
     return $ok
 }
 

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