aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-03-27 23:53:08 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-03-27 23:53:08 +0000
commit7ffe3584805254da8b6cefbb89ebf4da8951c400 (patch)
tree2e5d7d573a5b7434c1a66870ae9f6c79faaea5d7
parent01e60c33e6168fec1d7a79467b412d20a686bcf8 (diff)
downloadgcc-7ffe3584805254da8b6cefbb89ebf4da8951c400.zip
gcc-7ffe3584805254da8b6cefbb89ebf4da8951c400.tar.gz
gcc-7ffe3584805254da8b6cefbb89ebf4da8951c400.tar.bz2
gcov.exp (run-gcov): Add branches and calls options, rather than reading .x files.
* lib/gcov.exp (run-gcov): Add branches and calls options, rather than reading .x files. * g++.dg/gcov/gcov-1.C: Use run-gcov options, not .x files. * g77.dg/gcov/gcov-1.f: Likewise. * gcc.misc-tests/gcov-4b.c: Likewise. * gcc.misc-tests/gcov-5b.c: Likewise. * gcc.misc-tests/gcov-6.c: Likewise. * gcc.misc-tests/gcov-7.c: Likewise. * gcc.misc-tests/gcov-8.c: Likewise. * g++.dg/gcov/gcov-1.x: Remove. * g77.dg/gcov/gcov-1.x: Likewise. * gcc.misc-tests/gcov-4b.x: Likewise. * gcc.misc-tests/gcov-5b.x: Likewise. * gcc.misc-tests/gcov-6.x: Likewise. * gcc.misc-tests/gcov-7.x: Likewise. * gcc.misc-tests/gcov-8.x: Likewise. From-SVN: r64937
-rw-r--r--gcc/testsuite/ChangeLog19
-rw-r--r--gcc/testsuite/g++.dg/gcov/gcov-1.C2
-rw-r--r--gcc/testsuite/g++.dg/gcov/gcov-1.x2
-rw-r--r--gcc/testsuite/g77.dg/gcov/gcov-1.f2
-rw-r--r--gcc/testsuite/g77.dg/gcov/gcov-1.x3
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-4b.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-4b.x2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-5b.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-5b.x2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-6.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-6.x3
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-7.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-7.x3
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-8.c2
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-8.x2
-rw-r--r--gcc/testsuite/lib/gcov.exp43
16 files changed, 49 insertions, 44 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3fa3883..c438ad3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,22 @@
+2003-03-27 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/gcov.exp (run-gcov): Add branches and calls options, rather
+ than reading .x files.
+ * g++.dg/gcov/gcov-1.C: Use run-gcov options, not .x files.
+ * g77.dg/gcov/gcov-1.f: Likewise.
+ * gcc.misc-tests/gcov-4b.c: Likewise.
+ * gcc.misc-tests/gcov-5b.c: Likewise.
+ * gcc.misc-tests/gcov-6.c: Likewise.
+ * gcc.misc-tests/gcov-7.c: Likewise.
+ * gcc.misc-tests/gcov-8.c: Likewise.
+ * g++.dg/gcov/gcov-1.x: Remove.
+ * g77.dg/gcov/gcov-1.x: Likewise.
+ * gcc.misc-tests/gcov-4b.x: Likewise.
+ * gcc.misc-tests/gcov-5b.x: Likewise.
+ * gcc.misc-tests/gcov-6.x: Likewise.
+ * gcc.misc-tests/gcov-7.x: Likewise.
+ * gcc.misc-tests/gcov-8.x: Likewise.
+
2003-03-27 Glen Nakamura <glen@imodulo.com>
PR opt/10087
diff --git a/gcc/testsuite/g++.dg/gcov/gcov-1.C b/gcc/testsuite/g++.dg/gcov/gcov-1.C
index 6179944..6089ada 100644
--- a/gcc/testsuite/g++.dg/gcov/gcov-1.C
+++ b/gcc/testsuite/g++.dg/gcov/gcov-1.C
@@ -310,4 +310,4 @@ main()
return 0;
}
-/* { dg-final { run-gcov -b gcov-1.C } } */
+/* { dg-final { run-gcov branches { -b gcov-1.C } } } */
diff --git a/gcc/testsuite/g++.dg/gcov/gcov-1.x b/gcc/testsuite/g++.dg/gcov/gcov-1.x
deleted file mode 100644
index b01ef42..0000000
--- a/gcc/testsuite/g++.dg/gcov/gcov-1.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set gcov_verify_branches 1
-return 0
diff --git a/gcc/testsuite/g77.dg/gcov/gcov-1.f b/gcc/testsuite/g77.dg/gcov/gcov-1.f
index d710483..c4b82ec 100644
--- a/gcc/testsuite/g77.dg/gcov/gcov-1.f
+++ b/gcc/testsuite/g77.dg/gcov/gcov-1.f
@@ -424,4 +424,4 @@ C Test nested IF statements and IF with compound expressions.
end if
end
C
-C { dg-final { run-gcov -b gcov-1.f } }
+C { dg-final { run-gcov branches calls { -b gcov-1.f } } }
diff --git a/gcc/testsuite/g77.dg/gcov/gcov-1.x b/gcc/testsuite/g77.dg/gcov/gcov-1.x
deleted file mode 100644
index 8e4f50b..0000000
--- a/gcc/testsuite/g77.dg/gcov/gcov-1.x
+++ /dev/null
@@ -1,3 +0,0 @@
-set gcov_verify_branches 1
-set gcov_verify_calls 1
-return 0
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-4b.c b/gcc/testsuite/gcc.misc-tests/gcov-4b.c
index 72870b2..139f10d 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-4b.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-4b.c
@@ -258,4 +258,4 @@ main()
return 0;
}
-/* { dg-final { run-gcov -b gcov-4b.c } } */
+/* { dg-final { run-gcov branches { -b gcov-4b.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-4b.x b/gcc/testsuite/gcc.misc-tests/gcov-4b.x
deleted file mode 100644
index b01ef42..0000000
--- a/gcc/testsuite/gcc.misc-tests/gcov-4b.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set gcov_verify_branches 1
-return 0
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-5b.c b/gcc/testsuite/gcc.misc-tests/gcov-5b.c
index ec59e56..cbd3958 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-5b.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-5b.c
@@ -31,4 +31,4 @@ int main ()
return 0;
}
-/* { dg-final { run-gcov -b gcov-5b.c } } */
+/* { dg-final { run-gcov branches { -b gcov-5b.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-5b.x b/gcc/testsuite/gcc.misc-tests/gcov-5b.x
deleted file mode 100644
index b01ef42..0000000
--- a/gcc/testsuite/gcc.misc-tests/gcov-5b.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set gcov_verify_branches 1
-return 0
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-6.c b/gcc/testsuite/gcc.misc-tests/gcov-6.c
index 34680d3..90273d5 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-6.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-6.c
@@ -34,4 +34,4 @@ main()
/* returns(end) */
}
-/* { dg-final { run-gcov -b gcov-6.c } } */
+/* { dg-final { run-gcov branches calls { -b gcov-6.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-6.x b/gcc/testsuite/gcc.misc-tests/gcov-6.x
deleted file mode 100644
index 8e4f50b..0000000
--- a/gcc/testsuite/gcc.misc-tests/gcov-6.x
+++ /dev/null
@@ -1,3 +0,0 @@
-set gcov_verify_branches 1
-set gcov_verify_calls 1
-return 0
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-7.c b/gcc/testsuite/gcc.misc-tests/gcov-7.c
index e0ed7a3..700cec6 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-7.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-7.c
@@ -81,4 +81,4 @@ main()
/* returns(end) */
}
-/* { dg-final { run-gcov -b gcov-7.c } } */
+/* { dg-final { run-gcov calls branches { -b gcov-7.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-7.x b/gcc/testsuite/gcc.misc-tests/gcov-7.x
deleted file mode 100644
index 8e4f50b..0000000
--- a/gcc/testsuite/gcc.misc-tests/gcov-7.x
+++ /dev/null
@@ -1,3 +0,0 @@
-set gcov_verify_branches 1
-set gcov_verify_calls 1
-return 0
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-8.c b/gcc/testsuite/gcc.misc-tests/gcov-8.c
index 4c95b3d..7223bde 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-8.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-8.c
@@ -44,4 +44,4 @@ int main ()
return t == 0;
}
-/* { dg-final { run-gcov -b gcov-8.c } } */
+/* { dg-final { run-gcov branches {-b gcov-8.c } } } */
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-8.x b/gcc/testsuite/gcc.misc-tests/gcov-8.x
deleted file mode 100644
index b01ef42..0000000
--- a/gcc/testsuite/gcc.misc-tests/gcov-8.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set gcov_verify_branches 1
-return 0
diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp
index 672156e..a6c70c4 100644
--- a/gcc/testsuite/lib/gcov.exp
+++ b/gcc/testsuite/lib/gcov.exp
@@ -217,37 +217,40 @@ proc verify-calls { testcase file } {
# Called by dg-final to run gcov and analyze the results.
#
-# ARGS is the options to pass to gcov followed by the name of the
-# test source file.
+# ARGS consists of the optional strings "branches" and/or "calls",
+# (indicating that these things should be verified) followed by a
+# list of arguments to provide to gcov, including the name of the
+# source file.
proc run-gcov { args } {
global GCOV
global srcdir subdir
- # Extract the test name from the arguments.
- set testcase [lindex $args end]
+ set gcov_args [lindex $args end]
+
+ set gcov_verify_calls 0
+ set gcov_verify_branches 0
+ set gcov_execute_xfail ""
+ set gcov_verify_xfail ""
- # Get special options for this test from the .x script, if present.
- # This can include:
- # gcov_execute_xfail string to pass to setup_xfail
- # gcov_verify_xfail string to pass to setup_xfail
- # gcov_verify_branches if defined, check branch percentages
- # gcov_verify_calls if defined, check call return percentages
- if [file exists [file rootname $srcdir/$subdir/$testcase].x] {
- set done_p 0
- catch "set done_p \[source [file rootname $srcdir/$subdir/$testcase].x\]"
- if { $done_p } {
- return
+ foreach a $args {
+ if { $a == "calls" } {
+ set gcov_verify_calls 1
+ } elseif { $a == "branches" } {
+ set gcov_verify_branches 1
}
}
- if [info exists gcov_execute_xfail] {
+ # Extract the test name from the arguments.
+ set testcase [lindex $gcov_args end]
+
+ if { $gcov_execute_xfail != "" } {
eval setup_xfail [split $gcov_execute_xfail]
}
verbose "Running $GCOV $testcase" 2
set testcase [remote_download host $testcase];
- set result [remote_exec host $GCOV $args];
+ set result [remote_exec host $GCOV $gcov_args];
if { [lindex $result 0] != 0 } {
fail "$subdir/$testcase gcov failed: [lindex $result 1]"
clean-gcov $testcase
@@ -263,7 +266,7 @@ proc run-gcov { args } {
}
remote_upload host $testcase.gcov $testcase.gcov;
- if [info exists gcov_verify_xfail] {
+ if { $gcov_verify_xfail != "" } {
eval setup_xfail [split $gcov_verify_xfail]
}
@@ -272,12 +275,12 @@ proc run-gcov { args } {
# If requested via the .x file, check that branch and call information
# is correct.
- if [info exists gcov_verify_branches] {
+ if { $gcov_verify_branches } {
set bfailed [verify-branches $testcase $testcase.gcov]
} else {
set bfailed 0
}
- if [info exists gcov_verify_calls] {
+ if { $gcov_verify_calls } {
set cfailed [verify-calls $testcase $testcase.gcov]
} else {
set cfailed 0