Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Nov 2014 09:13:57 -0800
From:      Arthur Mesh <amesh@juniper.net>
To:        <toolchain@freebsd.org>
Cc:        marcel@freebsd.org
Subject:   clang and code coverage
Message-ID:  <20141106171357.GZ15335@juniper.net>

next in thread | raw e-mail | index | archive | help
--xjCTGciBHXp1jY+V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 r2733=
80M: Tue Oct 21 10:19:02 PDT 2014     root@norse.englab.juniper.net:/usr/ob=
j/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:=20
$ cat test.c
#include <stdio.h>
=20
int
main (void)
{
  int i;
=20
  for (i =3D 1; i < 10; i++)
    {
      if (i % 3 =3D=3D 0)
        printf ("%d is divisible by 3\n", i);
      if (i % 11 =3D=3D 0)
        printf ("%d is divisible by 11\n", i);
    }
=20
  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 invocat=
ion)

FWIW, the same test work on MacOSX 10.10 clang.

Thanks

--=20
Arthur Mesh <amesh@juniper.net>
Juniper Networks
+1 408 936-4968

--xjCTGciBHXp1jY+V
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQGcBAEBCAAGBQJUW6xVAAoJEO/ZUtudxDnttRAL/3SAtetBAlu0NwEZeJYQl/6y
Kl6aOQzPSbpbz5eL3kc/Bw2LRWsjlpc4z8qNcFGH3dxI+ce0O0T/XbSqYES1D0YZ
KaYWFhAVqziLBQShrnIuR5QKqwAcTarwaUWDQC1dslmbSVX6PvY8m4HxkCrejVEf
jUyIBGDhjjZhhb8n60EloPhVliiVM50wVIOXPQEc3E77XPvC/OidS8Q1XOaU50oY
DJWoFN64oUYGPmNE3Hu8YEKjLDWrWhzyBI+nxYbQKWJo5trZa4XrFs+ASLGV12cr
E4HlwfAUVLuU8By7vWA27ReAWa8dFZDEuNvdLTvQBs5Kfnz3NH1rxPpE8V/bfYsC
OUGzkpxvfuAnszP8QtspscCpjmyS0R5NYWN6AYR8pL2tdT8EqnuBaKxb8MlccrMc
nor0cJgIBw6Qi2Mp/vLlCNSdR3IcQJ7Iby+o11ZznJnK3LdJ6cC2dbx3XB4sio1Y
7p6dLTaY7Scp9PxJOJ5kLbc7wKsq+upcmIuH0jr+Yg==
=05Vi
-----END PGP SIGNATURE-----

--xjCTGciBHXp1jY+V--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141106171357.GZ15335>