aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInvocationTest.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2021-01-05 19:45:31 +0100
committerJan Svoboda <jan_svoboda@apple.com>2021-01-05 20:10:07 +0100
commitf111cf992df4ec00acfdd026eac12b36c3831999 (patch)
tree1b47cbaf3aba05802323aff3dd635e112abdbda9 /clang/unittests/Frontend/CompilerInvocationTest.cpp
parent28a326eba0a9c367ab6a2d23ca0ae4fb8ab2b536 (diff)
downloadllvm-f111cf992df4ec00acfdd026eac12b36c3831999.zip
llvm-f111cf992df4ec00acfdd026eac12b36c3831999.tar.gz
llvm-f111cf992df4ec00acfdd026eac12b36c3831999.tar.bz2
[clang][cli] Specify correct integer width for -fbuild-session-timestamp
This fixes an issue where large integer values were rejected as invalid. Reviewed By: arphaman Differential Revision: https://reviews.llvm.org/D94101
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
-rw-r--r--clang/unittests/Frontend/CompilerInvocationTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp
index 51b7ba8..83ae169 100644
--- a/clang/unittests/Frontend/CompilerInvocationTest.cpp
+++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp
@@ -368,6 +368,18 @@ TEST_F(CommandLineTest, CanGenerateCC1COmmandLineSeparateEnumDefault) {
ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq("pic"))));
}
+// Wide integer option.
+
+TEST_F(CommandLineTest, WideIntegerHighValue) {
+ const char *Args[] = {"-fbuild-session-timestamp=1609827494445723662"};
+
+ CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
+
+ ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_EQ(Invocation.getHeaderSearchOpts().BuildSessionTimestamp,
+ 1609827494445723662ull);
+}
+
// Tree of boolean options that can be (directly or transitively) implied by
// their parent:
//