From f111cf992df4ec00acfdd026eac12b36c3831999 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 5 Jan 2021 19:45:31 +0100 Subject: [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 --- clang/unittests/Frontend/CompilerInvocationTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp') 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: // -- cgit v1.1