[z/OS][pg] Throw error when using -pg on z/OS

Throw an error when trying to compile with `-pg` on z/OS,
as the platform does not support `gprof`.

Reviewed By: cebowleratibm, MaskRay

Differential Revision: https://reviews.llvm.org/D137756
This commit is contained in:
Michael Francis
2023-01-09 18:35:54 +00:00
parent 7f85c560b4
commit ec094d259e
2 changed files with 8 additions and 0 deletions

View File

@@ -6338,6 +6338,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
<< A->getAsString(Args) << TripleStr;
}
}
if (Arg *A = Args.getLastArgNoClaim(options::OPT_pg)) {
if (TC.getTriple().isOSzOS()) {
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< A->getAsString(Args) << TripleStr;
}
}
if (Args.getLastArg(options::OPT_fapple_kext) ||
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))

View File

@@ -0,0 +1,2 @@
// RUN: %clang 2>&1 -### --target=s390x-none-zos -pg -S %s | FileCheck -check-prefix=FAIL-PG-NAME %s
// FAIL-PG-NAME: error: unsupported option '-pg' for target 's390x-none-zos'