clang and code coverage

Arthur Mesh amesh at juniper.net
Thu Nov 6 17:14:13 UTC 2014


Folks,

Does FreeBSD's clang support code coverage? It appears to lack necessary run
time libs:

$ uname -a
FreeBSD norse.englab.juniper.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r273380M: Tue Oct 21 10:19:02 PDT 2014     root at norse.englab.juniper.net:/usr/obj/usr/src/sys/GENERIC  amd64
$ clang -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd11.0
Thread model: posix
Selected GCC installation: 
$ cat test.c
#include <stdio.h>
 
int
main (void)
{
  int i;
 
  for (i = 1; i < 10; i++)
    {
      if (i % 3 == 0)
        printf ("%d is divisible by 3\n", i);
      if (i % 11 == 0)
        printf ("%d is divisible by 11\n", i);
    }
 
  return 0;
}
$ clang -fprofile-arcs -ftest-coverage cov.c
/usr/bin/ld: /usr/bin/../lib/libprofile_rt.a: No such file: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FWIW, the same test work on MacOSX 10.10 clang.

Thanks

-- 
Arthur Mesh <amesh at juniper.net>
Juniper Networks
+1 408 936-4968
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 648 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20141106/c7d3465f/attachment.sig>


More information about the freebsd-toolchain mailing list