diff options
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
-rw-r--r-- | clang/unittests/Frontend/CompilerInvocationTest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp index 75390aa..1332422 100644 --- a/clang/unittests/Frontend/CompilerInvocationTest.cpp +++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp @@ -732,6 +732,26 @@ TEST_F(CommandLineTest, ConditionalParsingIfTrueFlagPresent) { ASSERT_THAT(GeneratedArgs, Contains(StrEq("-sycl-std=2017"))); } +TEST_F(CommandLineTest, ConditionalParsingIfHLSLFlagPresent) { + const char *Args[] = {"-xhlsl"}; + + CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags); + + ASSERT_EQ(Invocation.getLangOpts().MaxMatrixDimension, 4u); + + Invocation.generateCC1CommandLine(GeneratedArgs, *this); +} + +TEST_F(CommandLineTest, ConditionalParsingIfHLSLFlagNotPresent) { + const char *Args[] = {""}; + + CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags); + + ASSERT_EQ(Invocation.getLangOpts().MaxMatrixDimension, 1048575u); + + Invocation.generateCC1CommandLine(GeneratedArgs, *this); +} + // Wide integer option. TEST_F(CommandLineTest, WideIntegerHighValue) { |