diff options
author | Geoffrey Keating <geoffk@apple.com> | 2002-11-11 23:41:37 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@apple.com> | 2002-11-11 23:41:37 +0000 |
commit | d0c19347cf78102d02eb6f51efe119b40ad2b5dd (patch) | |
tree | 54ba6f47c0b3dfbecdc7097b2344c90b50903132 | |
parent | 594b4e94b5366e810b4648fefe95340a5b665aee (diff) |
* gcc.dg/pch/pch.exp: Compare .s files with/without PCH,
rather than trying to build and run a program using PCH.
* gcc.dg/pch: Remove dg-do commands from test files.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/pch-branch@59031 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/common-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/decl-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/decl-2.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/decl-3.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/decl-4.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/decl-5.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/empty.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/global-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/inline-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/inline-2.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/macro-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/macro-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/macro-3.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/pch.exp | 39 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/static-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/static-2.c | 1 |
17 files changed, 41 insertions, 23 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7d7445ddf5..f6d7e8401c9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-11-11 Geoffrey Keating <geoffk@apple.com> + + * gcc.dg/pch/pch.exp: Compare .s files with/without PCH, + rather than trying to build and run a program using PCH. + * gcc.dg/pch: Remove dg-do commands from test files. + 2002-11-08 Geoffrey Keating <geoffk@apple.com> * gcc.dg/pch/macro-3.c: New. diff --git a/gcc/testsuite/gcc.dg/pch/common-1.c b/gcc/testsuite/gcc.dg/pch/common-1.c index f158b4d4018..ec573102853 100644 --- a/gcc/testsuite/gcc.dg/pch/common-1.c +++ b/gcc/testsuite/gcc.dg/pch/common-1.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "common-1.h" int foo2 = 3; int zz = 2; diff --git a/gcc/testsuite/gcc.dg/pch/decl-1.c b/gcc/testsuite/gcc.dg/pch/decl-1.c index a3e3ebbfb72..5d6bb1d4aaf 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-1.c +++ b/gcc/testsuite/gcc.dg/pch/decl-1.c @@ -1,3 +1,2 @@ -/* { dg-do compile } */ #include "decl-1.h" int main(void) { return foo; } diff --git a/gcc/testsuite/gcc.dg/pch/decl-2.c b/gcc/testsuite/gcc.dg/pch/decl-2.c index e2d5ddecda4..72b6538b932 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-2.c +++ b/gcc/testsuite/gcc.dg/pch/decl-2.c @@ -1,3 +1,2 @@ -/* { dg-do compile } */ #include "decl-2.h" int main(void) { return fun (1, 2); } diff --git a/gcc/testsuite/gcc.dg/pch/decl-3.c b/gcc/testsuite/gcc.dg/pch/decl-3.c index 9be907b1005..c12abbb1cf4 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-3.c +++ b/gcc/testsuite/gcc.dg/pch/decl-3.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "decl-3.h" foo_p bar (void) diff --git a/gcc/testsuite/gcc.dg/pch/decl-4.c b/gcc/testsuite/gcc.dg/pch/decl-4.c index 1a10e9b2589..61affdbc0c8 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-4.c +++ b/gcc/testsuite/gcc.dg/pch/decl-4.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "decl-4.h" int bar (foo_p f) diff --git a/gcc/testsuite/gcc.dg/pch/decl-5.c b/gcc/testsuite/gcc.dg/pch/decl-5.c index cd0edc0f771..705c2fe0df1 100644 --- a/gcc/testsuite/gcc.dg/pch/decl-5.c +++ b/gcc/testsuite/gcc.dg/pch/decl-5.c @@ -1,3 +1,2 @@ -/* { dg-do compile } */ #include "decl-5.h" static int (*t)(void) = foo; diff --git a/gcc/testsuite/gcc.dg/pch/empty.c b/gcc/testsuite/gcc.dg/pch/empty.c index 26ca7cd7758..330876cc7c7 100644 --- a/gcc/testsuite/gcc.dg/pch/empty.c +++ b/gcc/testsuite/gcc.dg/pch/empty.c @@ -1,5 +1,3 @@ -/* { dg-do run } */ - /* 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" diff --git a/gcc/testsuite/gcc.dg/pch/global-1.c b/gcc/testsuite/gcc.dg/pch/global-1.c index 9594a3302d3..c1cff5f1c53 100644 --- a/gcc/testsuite/gcc.dg/pch/global-1.c +++ b/gcc/testsuite/gcc.dg/pch/global-1.c @@ -1,3 +1,2 @@ -/* { dg-do compile } */ #include "global-1.h" const int bar = 3; diff --git a/gcc/testsuite/gcc.dg/pch/inline-1.c b/gcc/testsuite/gcc.dg/pch/inline-1.c index f49122ae0d8..38fad39c459 100644 --- a/gcc/testsuite/gcc.dg/pch/inline-1.c +++ b/gcc/testsuite/gcc.dg/pch/inline-1.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "inline-1.h" int bar(int a, int b) { diff --git a/gcc/testsuite/gcc.dg/pch/inline-2.c b/gcc/testsuite/gcc.dg/pch/inline-2.c index 382351fc74c..59b238a3b7a 100644 --- a/gcc/testsuite/gcc.dg/pch/inline-2.c +++ b/gcc/testsuite/gcc.dg/pch/inline-2.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "inline-2.h" extern inline char bar(int a) diff --git a/gcc/testsuite/gcc.dg/pch/macro-1.c b/gcc/testsuite/gcc.dg/pch/macro-1.c index 6f59582cbc7..3775004a77b 100644 --- a/gcc/testsuite/gcc.dg/pch/macro-1.c +++ b/gcc/testsuite/gcc.dg/pch/macro-1.c @@ -1,5 +1,3 @@ -/* { dg-do run } */ - #include "macro-1.hp" int main(void) diff --git a/gcc/testsuite/gcc.dg/pch/macro-2.c b/gcc/testsuite/gcc.dg/pch/macro-2.c index 09a552fce32..d058e2bb869 100644 --- a/gcc/testsuite/gcc.dg/pch/macro-2.c +++ b/gcc/testsuite/gcc.dg/pch/macro-2.c @@ -1,5 +1,3 @@ -/* { dg-do run } */ - #define DEFINED_VALUE_2 3 #include "macro-2.hp" diff --git a/gcc/testsuite/gcc.dg/pch/macro-3.c b/gcc/testsuite/gcc.dg/pch/macro-3.c index ead0bcc4150..40ee46e4f3a 100644 --- a/gcc/testsuite/gcc.dg/pch/macro-3.c +++ b/gcc/testsuite/gcc.dg/pch/macro-3.c @@ -1,5 +1,3 @@ -/* { dg-do run } */ - #define DEFINED_FUNC_2(x) (3 + (x)) #include "macro-3.hp" diff --git a/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc/testsuite/gcc.dg/pch/pch.exp index aa8b2b2174c..b4701f7817e 100644 --- a/gcc/testsuite/gcc.dg/pch/pch.exp +++ b/gcc/testsuite/gcc.dg/pch/pch.exp @@ -23,6 +23,8 @@ load_lib gcc-dg.exp # Initialize `dg'. dg-init +set old_dg_do_what_default "${dg-do-what-default}" + # Main loop. foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { global runtests torture_without_loops dg-do-what-default @@ -36,6 +38,8 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { catch { file delete "$bname.hp.pch" } catch { file delete "$bname.h.pch" } + catch { file delete "$bname.s" } + catch { file delete "$bname.s-pch" } # We don't try to use the loop-optimizing options, since they are highly # unlikely to make any difference to PCH. @@ -43,10 +47,11 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { verbose "Testing $nshort, $flags" 1 # For the header files, the default is to precompile. - set old_dg_do_what_default "${dg-do-what-default}" set dg-do-what-default precompile dg-test -keep-output "[file rootname $test].h" $flags "" - set dg-do-what-default "$old_dg_do_what_default" + + # 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, @@ -56,13 +61,39 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { remote_download host "$bname.hp.pch" } - dg-test $test $flags "-I." + dg-test -keep-output $test $flags "-I." file delete "$bname.hp.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" + } + 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" + } elseif { $tmp == 1 } { + pass "$nshort $flags assembly comparison" + } else { + fail "$nshort $flags assembly comparison" + } + file delete "$bname.s" + file delete "$bname.s-pch" + } else { + untested "$nshort $flags assembly comparison" + } + } else { - untested $test + untested $nshort + untested "$nshort $flags assembly comparison" } } } +set dg-do-what-default "$old_dg_do_what_default" + # All done. dg-finish diff --git a/gcc/testsuite/gcc.dg/pch/static-1.c b/gcc/testsuite/gcc.dg/pch/static-1.c index 10fa1f39bc0..33a13912045 100644 --- a/gcc/testsuite/gcc.dg/pch/static-1.c +++ b/gcc/testsuite/gcc.dg/pch/static-1.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "static-1.h" static int bar(void) { diff --git a/gcc/testsuite/gcc.dg/pch/static-2.c b/gcc/testsuite/gcc.dg/pch/static-2.c index cfa8e90ca54..23e9af12679 100644 --- a/gcc/testsuite/gcc.dg/pch/static-2.c +++ b/gcc/testsuite/gcc.dg/pch/static-2.c @@ -1,4 +1,3 @@ -/* { dg-do compile } */ #include "static-2.h" int bar(void) { |