aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2005-03-04 04:43:03 +0000
committerBen Elliston <bje@au.ibm.com>2005-03-04 04:43:03 +0000
commit3f0792f336ce449b369c378af04414931caf214d (patch)
tree0ae9adc5763c0f414c1e7844ef1f48831d53a205 /gcc/gcc.c
parentbb592badcf6fbb4d93ff62fb3347446af9a40e0c (diff)
* gcc.c (option_map): Add --coverage.
(LINK_COMMAND_SPEC): Pass -lgcov for `coverage'. (cc1_options): Pass -fprofile-arcs -ftest-coverage for `coverage'. * config/darwin.h: Pass -lgcov for `coverage'. * doc/invoke.texi (Debugging Options): Document --coverage. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@95878 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1a9cc5005d6..eda3fa49f53 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -700,7 +700,7 @@ proper position among the other output files. */
%(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
- %{fprofile-arcs|fprofile-generate:-lgcov}\
+ %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
%{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
@@ -796,7 +796,8 @@ static const char *cc1_options =
%{--target-help:--target-help}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
%{fsyntax-only:-o %j} %{-param*}\
- %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}";
+ %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
+ %{coverage:-fprofile-arcs -ftest-coverage}";
static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
@@ -1065,6 +1066,7 @@ static const struct option_map option_map[] =
{"--for-assembler", "-Wa", "a"},
{"--for-linker", "-Xlinker", "a"},
{"--force-link", "-u", "a"},
+ {"--coverage", "-coverage", 0},
{"--imacros", "-imacros", "a"},
{"--include", "-include", "a"},
{"--include-barrier", "-I-", 0},