francii updated this revision to Diff 501527. francii added a comment. Merge z/OS and AIX profiling tests
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145021/new/ https://reviews.llvm.org/D145021 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/ibm-profiling.c clang/test/Driver/unused.c clang/test/Driver/zos-profiling-error.c Index: clang/test/Driver/zos-profiling-error.c =================================================================== --- clang/test/Driver/zos-profiling-error.c +++ /dev/null @@ -1,2 +0,0 @@ -// 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' Index: clang/test/Driver/unused.c =================================================================== --- /dev/null +++ clang/test/Driver/unused.c @@ -0,0 +1,8 @@ +// Check that -p is still used when not linking on AIX. +// RUN: %clang %s -### 2>&1 \ +// RUN: -p \ +// RUN: -S \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefix=UNUSED %s +// UNUSED-NOT: warning: argument unused during compilation: '-p' + Index: clang/test/Driver/ibm-profiling.c =================================================================== --- /dev/null +++ clang/test/Driver/ibm-profiling.c @@ -0,0 +1,10 @@ +// 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' + +// Check that -p is still used when not linking on AIX. +// RUN: %clang %s -### 2>&1 \ +// RUN: -p \ +// RUN: -S \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefix=UNUSED %s +// UNUSED-NOT: warning: argument unused during compilation: '-p' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -6324,7 +6324,7 @@ << A->getAsString(Args) << TripleStr; } } - if (Arg *A = Args.getLastArgNoClaim(options::OPT_p)) { + if (Arg *A = Args.getLastArg(options::OPT_p)) { if (TC.getTriple().isOSAIX()) { CmdArgs.push_back("-pg"); } else if (!TC.getTriple().isOSOpenBSD()) {
Index: clang/test/Driver/zos-profiling-error.c =================================================================== --- clang/test/Driver/zos-profiling-error.c +++ /dev/null @@ -1,2 +0,0 @@ -// 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' Index: clang/test/Driver/unused.c =================================================================== --- /dev/null +++ clang/test/Driver/unused.c @@ -0,0 +1,8 @@ +// Check that -p is still used when not linking on AIX. +// RUN: %clang %s -### 2>&1 \ +// RUN: -p \ +// RUN: -S \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefix=UNUSED %s +// UNUSED-NOT: warning: argument unused during compilation: '-p' + Index: clang/test/Driver/ibm-profiling.c =================================================================== --- /dev/null +++ clang/test/Driver/ibm-profiling.c @@ -0,0 +1,10 @@ +// 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' + +// Check that -p is still used when not linking on AIX. +// RUN: %clang %s -### 2>&1 \ +// RUN: -p \ +// RUN: -S \ +// RUN: --target=powerpc-ibm-aix7.1.0.0 \ +// RUN: | FileCheck --check-prefix=UNUSED %s +// UNUSED-NOT: warning: argument unused during compilation: '-p' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -6324,7 +6324,7 @@ << A->getAsString(Args) << TripleStr; } } - if (Arg *A = Args.getLastArgNoClaim(options::OPT_p)) { + if (Arg *A = Args.getLastArg(options::OPT_p)) { if (TC.getTriple().isOSAIX()) { CmdArgs.push_back("-pg"); } else if (!TC.getTriple().isOSOpenBSD()) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits