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
This commit is contained in:
parent
c4274b22b9
commit
50c620d648
40 changed files with 34 additions and 35 deletions
|
@ -1,3 +1,10 @@
|
|||
2003-01-16 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* 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 <mark@codesourcery.com>
|
||||
|
||||
* gcc/testsuite/g++.dg/ext/typename1.C: Add typename keyword.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#include "common-1.hp"
|
||||
#include "common-1.h"
|
||||
int foo2 = 3;
|
||||
int zz = 2;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "cpp-1.hp"
|
||||
#include "cpp-1.h"
|
||||
#if !defined(__GNUC__)
|
||||
panic! panic!
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-options "-Wunknown-pragmas -I." } */
|
||||
#include "cpp-2.hp"
|
||||
#include "cpp-2.h"
|
||||
#pragma GCC poison not_used
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "decl-1.hp"
|
||||
#include "decl-1.h"
|
||||
int main(void) { return foo; }
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "decl-2.hp"
|
||||
#include "decl-2.h"
|
||||
int main(void) { return fun (1, 2); }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "decl-3.hp"
|
||||
#include "decl-3.h"
|
||||
|
||||
foo_p bar (void)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "decl-4.hp"
|
||||
#include "decl-4.h"
|
||||
|
||||
int bar (foo_p f)
|
||||
{
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "decl-5.hp"
|
||||
#include "decl-5.h"
|
||||
static int (*t)(void) = foo;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* { dg-options "-fexceptions -I." } */
|
||||
#include "except-1.hp"
|
||||
#include "except-1.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "global-1.hp"
|
||||
#include "global-1.h"
|
||||
const int bar = 3;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "inline-1.hp"
|
||||
#include "inline-1.h"
|
||||
int bar(int a, int b)
|
||||
{
|
||||
return foo(a) + b;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "inline-2.hp"
|
||||
#include "inline-2.h"
|
||||
extern inline char
|
||||
bar(int a)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "macro-1.hp"
|
||||
#include "macro-1.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define DEFINED_VALUE_2 3
|
||||
|
||||
#include "macro-2.hp"
|
||||
#include "macro-2.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define DEFINED_FUNC_2(x) (3 + (x))
|
||||
|
||||
#include "macro-3.hp"
|
||||
#include "macro-3.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
|
|
@ -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 "<foo>.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 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "static-1.hp"
|
||||
#include "static-1.h"
|
||||
static int bar(void)
|
||||
{
|
||||
static int counter;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "static-2.hp"
|
||||
#include "static-2.h"
|
||||
int bar(void)
|
||||
{
|
||||
static int counter;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "system-1.hp"
|
||||
#include "system-1.h"
|
||||
int main(void)
|
||||
{
|
||||
puts ("hello world!");
|
||||
|
|
Loading…
Add table
Reference in a new issue