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
14 lines
645 B
C++
14 lines
645 B
C++
// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd10.0 2>&1 \
|
|
// RUN: | FileCheck --check-prefix=CHECK-TEN %s
|
|
// RUN: %clangxx %s -### -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
|
|
// RUN: | FileCheck --check-prefix=CHECK-NINE %s
|
|
// CHECK-TEN: "-lc++" "-lm"
|
|
// CHECK-NINE: "-lstdc++" "-lm"
|
|
|
|
// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd10.0 2>&1 \
|
|
// RUN: | FileCheck --check-prefix=CHECK-PG-TEN %s
|
|
// RUN: %clangxx %s -### -pg -o %t.o -target amd64-unknown-freebsd9.2 2>&1 \
|
|
// RUN: | FileCheck --check-prefix=CHECK-PG-NINE %s
|
|
// CHECK-PG-TEN: "-lc++_p" "-lm_p"
|
|
// CHECK-PG-NINE: "-lstdc++_p" "-lm_p"
|