From 50c620d648990c032a5ac8afdcbb783efc66eedd Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 16 Jan 2003 18:48:09 -0800 Subject: [PATCH] pch.exp: Copy test header to the working directory before using it either for... * gcc.dg/pch/pch.exp: Copy test header to the working directory before using it either for precompilation or direct use. * gcc.dg/pch/*.hs: Rename from gcc.dg/pch/*.h. * gcc.dg/pch/*.c: Include foo.h, not foo.hp. From-SVN: r61419 --- gcc/testsuite/ChangeLog | 7 ++++++ gcc/testsuite/gcc.dg/pch/common-1.c | 2 +- .../gcc.dg/pch/{common-1.h => common-1.hs} | 0 gcc/testsuite/gcc.dg/pch/cpp-1.c | 2 +- .../gcc.dg/pch/{cpp-1.h => cpp-1.hs} | 0 gcc/testsuite/gcc.dg/pch/cpp-2.c | 2 +- .../gcc.dg/pch/{cpp-2.h => cpp-2.hs} | 0 gcc/testsuite/gcc.dg/pch/decl-1.c | 2 +- .../gcc.dg/pch/{decl-1.h => decl-1.hs} | 0 gcc/testsuite/gcc.dg/pch/decl-2.c | 2 +- .../gcc.dg/pch/{decl-2.h => decl-2.hs} | 0 gcc/testsuite/gcc.dg/pch/decl-3.c | 2 +- .../gcc.dg/pch/{decl-3.h => decl-3.hs} | 0 gcc/testsuite/gcc.dg/pch/decl-4.c | 2 +- .../gcc.dg/pch/{decl-4.h => decl-4.hs} | 0 gcc/testsuite/gcc.dg/pch/decl-5.c | 2 +- .../gcc.dg/pch/{decl-5.h => decl-5.hs} | 0 gcc/testsuite/gcc.dg/pch/empty.c | 2 +- .../gcc.dg/pch/{empty.h => empty.hs} | 0 gcc/testsuite/gcc.dg/pch/except-1.c | 2 +- .../gcc.dg/pch/{except-1.h => except-1.hs} | 0 gcc/testsuite/gcc.dg/pch/global-1.c | 2 +- .../gcc.dg/pch/{global-1.h => global-1.hs} | 0 gcc/testsuite/gcc.dg/pch/inline-1.c | 2 +- .../gcc.dg/pch/{inline-1.h => inline-1.hs} | 0 gcc/testsuite/gcc.dg/pch/inline-2.c | 2 +- .../gcc.dg/pch/{inline-2.h => inline-2.hs} | 0 gcc/testsuite/gcc.dg/pch/macro-1.c | 2 +- .../gcc.dg/pch/{macro-1.h => macro-1.hs} | 0 gcc/testsuite/gcc.dg/pch/macro-2.c | 2 +- .../gcc.dg/pch/{macro-2.h => macro-2.hs} | 0 gcc/testsuite/gcc.dg/pch/macro-3.c | 2 +- .../gcc.dg/pch/{macro-3.h => macro-3.hs} | 0 gcc/testsuite/gcc.dg/pch/pch.exp | 24 +++++++------------ gcc/testsuite/gcc.dg/pch/static-1.c | 2 +- .../gcc.dg/pch/{static-1.h => static-1.hs} | 0 gcc/testsuite/gcc.dg/pch/static-2.c | 2 +- .../gcc.dg/pch/{static-2.h => static-2.hs} | 0 gcc/testsuite/gcc.dg/pch/system-1.c | 2 +- .../gcc.dg/pch/{system-1.h => system-1.hs} | 0 40 files changed, 34 insertions(+), 35 deletions(-) rename gcc/testsuite/gcc.dg/pch/{common-1.h => common-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{cpp-1.h => cpp-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{cpp-2.h => cpp-2.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{decl-1.h => decl-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{decl-2.h => decl-2.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{decl-3.h => decl-3.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{decl-4.h => decl-4.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{decl-5.h => decl-5.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{empty.h => empty.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{except-1.h => except-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{global-1.h => global-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{inline-1.h => inline-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{inline-2.h => inline-2.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{macro-1.h => macro-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{macro-2.h => macro-2.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{macro-3.h => macro-3.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{static-1.h => static-1.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{static-2.h => static-2.hs} (100%) rename gcc/testsuite/gcc.dg/pch/{system-1.h => system-1.hs} (100%) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 55e4028613f..c4f00625ae5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2003-01-16 Richard Henderson + + * gcc.dg/pch/pch.exp: Copy test header to the working directory + before using it either for precompilation or direct use. + * gcc.dg/pch/*.hs: Rename from gcc.dg/pch/*.h. + * gcc.dg/pch/*.c: Include foo.h, not foo.hp. + 2003-01-16 Mark Mitchell * gcc/testsuite/g++.dg/ext/typename1.C: Add typename keyword. diff --git a/gcc/testsuite/gcc.dg/pch/common-1.c b/gcc/testsuite/gcc.dg/pch/common-1.c index dcf148a2a72..ec573102853 100644 --- a/gcc/testsuite/gcc.dg/pch/common-1.c +++ b/gcc/testsuite/gcc.dg/pch/common-1.c @@ -1,3 +1,3 @@ -#include "common-1.hp" +#include "common-1.h" int foo2 = 3; int zz = 2; diff --git a/gcc/testsuite/gcc.dg/pch/common-1.h b/gcc/testsuite/gcc.dg/pch/common-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/common-1.h rename to gcc/testsuite/gcc.dg/pch/common-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/cpp-1.c b/gcc/testsuite/gcc.dg/pch/cpp-1.c index 43256cad545..9a3d6700de3 100644 --- a/gcc/testsuite/gcc.dg/pch/cpp-1.c +++ b/gcc/testsuite/gcc.dg/pch/cpp-1.c @@ -1,4 +1,4 @@ -#include "cpp-1.hp" +#include "cpp-1.h" #if !defined(__GNUC__) panic! panic! #endif diff --git a/gcc/testsuite/gcc.dg/pch/cpp-1.h b/gcc/testsuite/gcc.dg/pch/cpp-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/cpp-1.h rename to gcc/testsuite/gcc.dg/pch/cpp-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/cpp-2.c b/gcc/testsuite/gcc.dg/pch/cpp-2.c index b76c22cdb04..aab84110e01 100644 --- a/gcc/testsuite/gcc.dg/pch/cpp-2.c +++ b/gcc/testsuite/gcc.dg/pch/cpp-2.c @@ -1,4 +1,4 @@ /* { dg-options "-Wunknown-pragmas -I." } */ -#include "cpp-2.hp" +#include "cpp-2.h" #pragma GCC poison not_used diff --git a/gcc/testsuite/gcc.dg/pch/cpp-2.h b/gcc/testsuite/gcc.dg/pch/cpp-2.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/cpp-2.h rename to gcc/testsuite/gcc.dg/pch/cpp-2.hs diff --git a/gcc/testsuite/gcc.dg/pch/decl-1.c b/gcc/testsuite/gcc.dg/pch/decl-1.c index e4120704d9b..5d6bb1d4aaf 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-1.c +++ b/gcc/testsuite/gcc.dg/pch/decl-1.c @@ -1,2 +1,2 @@ -#include "decl-1.hp" +#include "decl-1.h" int main(void) { return foo; } diff --git a/gcc/testsuite/gcc.dg/pch/decl-1.h b/gcc/testsuite/gcc.dg/pch/decl-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/decl-1.h rename to gcc/testsuite/gcc.dg/pch/decl-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/decl-2.c b/gcc/testsuite/gcc.dg/pch/decl-2.c index c374a17e3f7..72b6538b932 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-2.c +++ b/gcc/testsuite/gcc.dg/pch/decl-2.c @@ -1,2 +1,2 @@ -#include "decl-2.hp" +#include "decl-2.h" int main(void) { return fun (1, 2); } diff --git a/gcc/testsuite/gcc.dg/pch/decl-2.h b/gcc/testsuite/gcc.dg/pch/decl-2.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/decl-2.h rename to gcc/testsuite/gcc.dg/pch/decl-2.hs diff --git a/gcc/testsuite/gcc.dg/pch/decl-3.c b/gcc/testsuite/gcc.dg/pch/decl-3.c index 9c95b9ad08e..c12abbb1cf4 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-3.c +++ b/gcc/testsuite/gcc.dg/pch/decl-3.c @@ -1,4 +1,4 @@ -#include "decl-3.hp" +#include "decl-3.h" foo_p bar (void) { diff --git a/gcc/testsuite/gcc.dg/pch/decl-3.h b/gcc/testsuite/gcc.dg/pch/decl-3.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/decl-3.h rename to gcc/testsuite/gcc.dg/pch/decl-3.hs diff --git a/gcc/testsuite/gcc.dg/pch/decl-4.c b/gcc/testsuite/gcc.dg/pch/decl-4.c index 3efe3829ffc..61affdbc0c8 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-4.c +++ b/gcc/testsuite/gcc.dg/pch/decl-4.c @@ -1,4 +1,4 @@ -#include "decl-4.hp" +#include "decl-4.h" int bar (foo_p f) { diff --git a/gcc/testsuite/gcc.dg/pch/decl-4.h b/gcc/testsuite/gcc.dg/pch/decl-4.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/decl-4.h rename to gcc/testsuite/gcc.dg/pch/decl-4.hs diff --git a/gcc/testsuite/gcc.dg/pch/decl-5.c b/gcc/testsuite/gcc.dg/pch/decl-5.c index f94b33a1363..705c2fe0df1 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-5.c +++ b/gcc/testsuite/gcc.dg/pch/decl-5.c @@ -1,2 +1,2 @@ -#include "decl-5.hp" +#include "decl-5.h" static int (*t)(void) = foo; diff --git a/gcc/testsuite/gcc.dg/pch/decl-5.h b/gcc/testsuite/gcc.dg/pch/decl-5.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/decl-5.h rename to gcc/testsuite/gcc.dg/pch/decl-5.hs diff --git a/gcc/testsuite/gcc.dg/pch/empty.c b/gcc/testsuite/gcc.dg/pch/empty.c index 330876cc7c7..7daa7ca7fcd 100644 --- a/gcc/testsuite/gcc.dg/pch/empty.c +++ b/gcc/testsuite/gcc.dg/pch/empty.c @@ -1,6 +1,6 @@ /* Yes, it's called "empty" because it has no contents at all. Even this comment goes here, rather than in empty.h. */ -#include "empty.hp" +#include "empty.h" int main(void) { diff --git a/gcc/testsuite/gcc.dg/pch/empty.h b/gcc/testsuite/gcc.dg/pch/empty.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/empty.h rename to gcc/testsuite/gcc.dg/pch/empty.hs diff --git a/gcc/testsuite/gcc.dg/pch/except-1.c b/gcc/testsuite/gcc.dg/pch/except-1.c index 0332609de2d..f81b098d7d8 100644 --- a/gcc/testsuite/gcc.dg/pch/except-1.c +++ b/gcc/testsuite/gcc.dg/pch/except-1.c @@ -1,5 +1,5 @@ /* { dg-options "-fexceptions -I." } */ -#include "except-1.hp" +#include "except-1.h" int main(void) { diff --git a/gcc/testsuite/gcc.dg/pch/except-1.h b/gcc/testsuite/gcc.dg/pch/except-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/except-1.h rename to gcc/testsuite/gcc.dg/pch/except-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/global-1.c b/gcc/testsuite/gcc.dg/pch/global-1.c index 4cab062345e..c1cff5f1c53 100644 --- a/gcc/testsuite/gcc.dg/pch/global-1.c +++ b/gcc/testsuite/gcc.dg/pch/global-1.c @@ -1,2 +1,2 @@ -#include "global-1.hp" +#include "global-1.h" const int bar = 3; diff --git a/gcc/testsuite/gcc.dg/pch/global-1.h b/gcc/testsuite/gcc.dg/pch/global-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/global-1.h rename to gcc/testsuite/gcc.dg/pch/global-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/inline-1.c b/gcc/testsuite/gcc.dg/pch/inline-1.c index 7fc32d7f766..38fad39c459 100644 --- a/gcc/testsuite/gcc.dg/pch/inline-1.c +++ b/gcc/testsuite/gcc.dg/pch/inline-1.c @@ -1,4 +1,4 @@ -#include "inline-1.hp" +#include "inline-1.h" int bar(int a, int b) { return foo(a) + b; diff --git a/gcc/testsuite/gcc.dg/pch/inline-1.h b/gcc/testsuite/gcc.dg/pch/inline-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/inline-1.h rename to gcc/testsuite/gcc.dg/pch/inline-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/inline-2.c b/gcc/testsuite/gcc.dg/pch/inline-2.c index 7792c828b92..59b238a3b7a 100644 --- a/gcc/testsuite/gcc.dg/pch/inline-2.c +++ b/gcc/testsuite/gcc.dg/pch/inline-2.c @@ -1,4 +1,4 @@ -#include "inline-2.hp" +#include "inline-2.h" extern inline char bar(int a) { diff --git a/gcc/testsuite/gcc.dg/pch/inline-2.h b/gcc/testsuite/gcc.dg/pch/inline-2.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/inline-2.h rename to gcc/testsuite/gcc.dg/pch/inline-2.hs diff --git a/gcc/testsuite/gcc.dg/pch/macro-1.c b/gcc/testsuite/gcc.dg/pch/macro-1.c index 3775004a77b..70546bb092d 100644 --- a/gcc/testsuite/gcc.dg/pch/macro-1.c +++ b/gcc/testsuite/gcc.dg/pch/macro-1.c @@ -1,4 +1,4 @@ -#include "macro-1.hp" +#include "macro-1.h" int main(void) { diff --git a/gcc/testsuite/gcc.dg/pch/macro-1.h b/gcc/testsuite/gcc.dg/pch/macro-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/macro-1.h rename to gcc/testsuite/gcc.dg/pch/macro-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/macro-2.c b/gcc/testsuite/gcc.dg/pch/macro-2.c index d058e2bb869..e2d965ff1e8 100644 --- a/gcc/testsuite/gcc.dg/pch/macro-2.c +++ b/gcc/testsuite/gcc.dg/pch/macro-2.c @@ -1,6 +1,6 @@ #define DEFINED_VALUE_2 3 -#include "macro-2.hp" +#include "macro-2.h" int main(void) { diff --git a/gcc/testsuite/gcc.dg/pch/macro-2.h b/gcc/testsuite/gcc.dg/pch/macro-2.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/macro-2.h rename to gcc/testsuite/gcc.dg/pch/macro-2.hs diff --git a/gcc/testsuite/gcc.dg/pch/macro-3.c b/gcc/testsuite/gcc.dg/pch/macro-3.c index 40ee46e4f3a..493d954980b 100644 --- a/gcc/testsuite/gcc.dg/pch/macro-3.c +++ b/gcc/testsuite/gcc.dg/pch/macro-3.c @@ -1,6 +1,6 @@ #define DEFINED_FUNC_2(x) (3 + (x)) -#include "macro-3.hp" +#include "macro-3.h" int main(void) { diff --git a/gcc/testsuite/gcc.dg/pch/macro-3.h b/gcc/testsuite/gcc.dg/pch/macro-3.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/macro-3.h rename to gcc/testsuite/gcc.dg/pch/macro-3.hs diff --git a/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc/testsuite/gcc.dg/pch/pch.exp index 69422ca3ef0..746e8f96018 100644 --- a/gcc/testsuite/gcc.dg/pch/pch.exp +++ b/gcc/testsuite/gcc.dg/pch/pch.exp @@ -36,11 +36,10 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { set nshort [file tail [file dirname $test]]/[file tail $test] set bname "[file rootname [file tail $test]]" - catch { file delete "$bname.hp.pch" } catch { file delete "$bname.h.pch" } + catch { file delete "$bname.h" } catch { file delete "$bname.s" } catch { file delete "$bname.s-pch" } - catch { file delete "$bname.hp" } # We don't try to use the loop-optimizing options, since they are highly # unlikely to make any difference to PCH. @@ -49,30 +48,22 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { # For the header files, the default is to precompile. set dg-do-what-default precompile - dg-test -keep-output "[file rootname $test].h" $flags "" + file copy "[file rootname $test].hs" "$bname.h" + dg-test -keep-output "$bname.h" $flags "" # For the rest, the default is to compile to .s. set dg-do-what-default compile if { [ file exists "$bname.h.pch" ] } { - # To ensure that the PCH is used, not the original header, - # the actual PCH file is renamed to ".hp.pch". - file rename "$bname.h.pch" "$bname.hp.pch" - if { [ is_remote host ] } { - remote_download host "$bname.hp.pch" - } + # Ensure that the PCH file is used, not the original header. + file delete "$bname.h" dg-test -keep-output $test $flags "-I." - file delete "$bname.hp.pch" + file delete "$bname.h.pch" if { [ file exists "$bname.s" ] } { file rename "$bname.s" "$bname.s-pch" - if { [ is_remote host ] } { - remote_upload host "[file rootname $test].h" "$bname.hp" - } else { - file copy "[file rootname $test].h" "$bname.hp" - } + file copy "[file rootname $test].hs" "$bname.h" dg-test -keep-output $test $flags "-I." - remote_file host delete "$bname.hp" set tmp [ diff "$bname.s" "$bname.s-pch" ] if { $tmp == 0 } { untested "$nshort $flags assembly comparison" @@ -81,6 +72,7 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { } else { fail "$nshort $flags assembly comparison" } + file delete "$bname.h" file delete "$bname.s" file delete "$bname.s-pch" } else { diff --git a/gcc/testsuite/gcc.dg/pch/static-1.c b/gcc/testsuite/gcc.dg/pch/static-1.c index c1816e949b4..33a13912045 100644 --- a/gcc/testsuite/gcc.dg/pch/static-1.c +++ b/gcc/testsuite/gcc.dg/pch/static-1.c @@ -1,4 +1,4 @@ -#include "static-1.hp" +#include "static-1.h" static int bar(void) { static int counter; diff --git a/gcc/testsuite/gcc.dg/pch/static-1.h b/gcc/testsuite/gcc.dg/pch/static-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/static-1.h rename to gcc/testsuite/gcc.dg/pch/static-1.hs diff --git a/gcc/testsuite/gcc.dg/pch/static-2.c b/gcc/testsuite/gcc.dg/pch/static-2.c index afda874e279..23e9af12679 100644 --- a/gcc/testsuite/gcc.dg/pch/static-2.c +++ b/gcc/testsuite/gcc.dg/pch/static-2.c @@ -1,4 +1,4 @@ -#include "static-2.hp" +#include "static-2.h" int bar(void) { static int counter; diff --git a/gcc/testsuite/gcc.dg/pch/static-2.h b/gcc/testsuite/gcc.dg/pch/static-2.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/static-2.h rename to gcc/testsuite/gcc.dg/pch/static-2.hs diff --git a/gcc/testsuite/gcc.dg/pch/system-1.c b/gcc/testsuite/gcc.dg/pch/system-1.c index 096fe593e06..9fde1365d54 100644 --- a/gcc/testsuite/gcc.dg/pch/system-1.c +++ b/gcc/testsuite/gcc.dg/pch/system-1.c @@ -1,4 +1,4 @@ -#include "system-1.hp" +#include "system-1.h" int main(void) { puts ("hello world!"); diff --git a/gcc/testsuite/gcc.dg/pch/system-1.h b/gcc/testsuite/gcc.dg/pch/system-1.hs similarity index 100% rename from gcc/testsuite/gcc.dg/pch/system-1.h rename to gcc/testsuite/gcc.dg/pch/system-1.hs -- 2.30.2