aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2020-12-08 10:44:03 +0100
committerJan Svoboda <jan_svoboda@apple.com>2020-12-09 08:58:45 +0100
commit4894e423e7b4b121bd4fb23cdba9870ff0f2a6b6 (patch)
tree5cbf7c2054a0fc93cf7f41d5cee4637c0b999342
parent5afff86d26163bc3ba93fb299ccfc2522d3fdc94 (diff)
downloadllvm-project-4894e423e7b4b121bd4fb23cdba9870ff0f2a6b6.tar.gz
[clang][cli] CompilerInvocationTest: remove unnecessary command line arguments
Depends on D92827. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D92828
-rw-r--r--clang/unittests/Frontend/CompilerInvocationTest.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp
index 39929b8fc032..0eb76a13972c 100644
--- a/clang/unittests/Frontend/CompilerInvocationTest.cpp
+++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp
@@ -36,7 +36,7 @@ public:
};
TEST_F(CommandLineTest, OptIsInitializedWithCustomDefaultValue) {
- const char *Args[] = {"clang", "-xc++"};
+ const char *Args[] = {""};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -44,7 +44,7 @@ TEST_F(CommandLineTest, OptIsInitializedWithCustomDefaultValue) {
}
TEST_F(CommandLineTest, OptOfNegativeFlagIsPopulatedWithFalse) {
- const char *Args[] = {"clang", "-xc++", "-fno-temp-file"};
+ const char *Args[] = {"-fno-temp-file"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -52,7 +52,7 @@ TEST_F(CommandLineTest, OptOfNegativeFlagIsPopulatedWithFalse) {
}
TEST_F(CommandLineTest, OptsOfImpliedPositiveFlagArePopulatedWithTrue) {
- const char *Args[] = {"clang", "-xc++", "-cl-unsafe-math-optimizations"};
+ const char *Args[] = {"-cl-unsafe-math-optimizations"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -68,7 +68,7 @@ TEST_F(CommandLineTest, OptsOfImpliedPositiveFlagArePopulatedWithTrue) {
}
TEST_F(CommandLineTest, CanGenerateCC1CommandLineFlag) {
- const char *Args[] = {"clang", "-xc++", "-fmodules-strict-context-hash", "-"};
+ const char *Args[] = {"-fmodules-strict-context-hash"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -79,7 +79,7 @@ TEST_F(CommandLineTest, CanGenerateCC1CommandLineFlag) {
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparate) {
const char *TripleCStr = "i686-apple-darwin9";
- const char *Args[] = {"clang", "-xc++", "-triple", TripleCStr, "-"};
+ const char *Args[] = {"-triple", TripleCStr};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -91,8 +91,7 @@ TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparate) {
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateRequiredPresent) {
const std::string DefaultTriple =
llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple());
- const char *Args[] = {"clang", "-xc++", "-triple", DefaultTriple.c_str(),
- "-"};
+ const char *Args[] = {"-triple", DefaultTriple.c_str()};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -105,7 +104,7 @@ TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateRequiredPresent) {
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateRequiredAbsent) {
const std::string DefaultTriple =
llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple());
- const char *Args[] = {"clang", "-xc++", "-"};
+ const char *Args[] = {""};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -116,7 +115,7 @@ TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateRequiredAbsent) {
}
TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateEnumNonDefault) {
- const char *Args[] = {"clang", "-xc++", "-mrelocation-model", "static", "-"};
+ const char *Args[] = {"-mrelocation-model", "static"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -127,7 +126,7 @@ TEST_F(CommandLineTest, CanGenerateCC1CommandLineSeparateEnumNonDefault) {
}
TEST_F(CommandLineTest, CanGenerateCC1COmmandLineSeparateEnumDefault) {
- const char *Args[] = {"clang", "-xc++", "-mrelocation-model", "pic", "-"};
+ const char *Args[] = {"-mrelocation-model", "pic"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -138,7 +137,7 @@ TEST_F(CommandLineTest, CanGenerateCC1COmmandLineSeparateEnumDefault) {
}
TEST_F(CommandLineTest, NotPresentNegativeFlagNotGenerated) {
- const char *Args[] = {"clang", "-xc++"};
+ const char *Args[] = {""};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -148,7 +147,7 @@ TEST_F(CommandLineTest, NotPresentNegativeFlagNotGenerated) {
}
TEST_F(CommandLineTest, PresentNegativeFlagGenerated) {
- const char *Args[] = {"clang", "-xc++", "-fno-temp-file"};
+ const char *Args[] = {"-fno-temp-file"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -158,7 +157,7 @@ TEST_F(CommandLineTest, PresentNegativeFlagGenerated) {
}
TEST_F(CommandLineTest, NotPresentAndNotImpliedNotGenerated) {
- const char *Args[] = {"clang", "-xc++"};
+ const char *Args[] = {""};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -172,7 +171,7 @@ TEST_F(CommandLineTest, NotPresentAndNotImpliedNotGenerated) {
}
TEST_F(CommandLineTest, NotPresentAndImpliedNotGenerated) {
- const char *Args[] = {"clang", "-xc++", "-cl-unsafe-math-optimizations"};
+ const char *Args[] = {"-cl-unsafe-math-optimizations"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -185,8 +184,8 @@ TEST_F(CommandLineTest, NotPresentAndImpliedNotGenerated) {
}
TEST_F(CommandLineTest, PresentAndImpliedNotGenerated) {
- const char *Args[] = {"clang", "-xc++", "-cl-unsafe-math-optimizations",
- "-cl-mad-enable", "-menable-unsafe-fp-math"};
+ const char *Args[] = {"-cl-unsafe-math-optimizations", "-cl-mad-enable",
+ "-menable-unsafe-fp-math"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
@@ -199,8 +198,7 @@ TEST_F(CommandLineTest, PresentAndImpliedNotGenerated) {
}
TEST_F(CommandLineTest, PresentAndNotImpliedGenerated) {
- const char *Args[] = {"clang", "-xc++", "-cl-mad-enable",
- "-menable-unsafe-fp-math"};
+ const char *Args[] = {"-cl-mad-enable", "-menable-unsafe-fp-math"};
CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);