diff options
author | bje <bje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-04 04:43:03 +0000 |
---|---|---|
committer | bje <bje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-04 04:43:03 +0000 |
commit | 2c6695795181971e63d71f2070ff7901ae278ff8 (patch) | |
tree | 0ae9adc5763c0f414c1e7844ef1f48831d53a205 /gcc/gcc.c | |
parent | 51d5ff28e6db7669c5db0cd35ea1614cab7bc85d (diff) | |
download | gcc-2c6695795181971e63d71f2070ff7901ae278ff8.tar.gz |
* 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95878 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 6 |
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}, |