As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
authorDimitry Andric <dimitry@andric.com>
Sun, 14 Feb 2016 16:08:20 +0000 (16:08 +0000)
committerDimitry Andric <dimitry@andric.com>
Sun, 14 Feb 2016 16:08:20 +0000 (16:08 +0000)
commit6090739f8d92df046b4e0d64add0604477e8cb0a
tree7abbd66999d1fe84cb70d862c5078b0ce097857f
parent24c2a9a4e4d3ffa8ebecf85541857c58d734362d
As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
C++ programs compiled for profiling (using `-pg`) should be linked with
`-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not
with the regular C++ libraries.

Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add
a test case for it.  While here, extend the test case for the proper
passing of -lm and -lm_p.

Reviewers: compnerd, davide, dws, emaste
Reviewed By: compnerd
Differential Revision: http://reviews.llvm.org/D16264

llvm-svn: 260851
clang/lib/Driver/ToolChains.cpp
clang/lib/Driver/ToolChains.h
clang/test/Driver/freebsd.cpp