This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf111cf992df4: [clang][cli] Specify correct integer width for -fbuild-session-timestamp (authored by jansvoboda11).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94101/new/ https://reviews.llvm.org/D94101 Files: clang/include/clang/Driver/Options.td clang/unittests/Frontend/CompilerInvocationTest.cpp Index: clang/unittests/Frontend/CompilerInvocationTest.cpp =================================================================== --- clang/unittests/Frontend/CompilerInvocationTest.cpp +++ clang/unittests/Frontend/CompilerInvocationTest.cpp @@ -368,6 +368,18 @@ 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: // Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -1767,7 +1767,7 @@ def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">, Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">, HelpText<"Time when the current build session started">, - MarshallingInfoStringInt<"HeaderSearchOpts->BuildSessionTimestamp">; + MarshallingInfoStringInt<"HeaderSearchOpts->BuildSessionTimestamp", "0", "uint64_t">; def fbuild_session_file : Joined<["-"], "fbuild-session-file=">, Group<i_Group>, MetaVarName<"<file>">, HelpText<"Use the last modification time of <file> as the build session timestamp">;
Index: clang/unittests/Frontend/CompilerInvocationTest.cpp =================================================================== --- clang/unittests/Frontend/CompilerInvocationTest.cpp +++ clang/unittests/Frontend/CompilerInvocationTest.cpp @@ -368,6 +368,18 @@ 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: // Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -1767,7 +1767,7 @@ def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">, Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">, HelpText<"Time when the current build session started">, - MarshallingInfoStringInt<"HeaderSearchOpts->BuildSessionTimestamp">; + MarshallingInfoStringInt<"HeaderSearchOpts->BuildSessionTimestamp", "0", "uint64_t">; def fbuild_session_file : Joined<["-"], "fbuild-session-file=">, Group<i_Group>, MetaVarName<"<file>">, HelpText<"Use the last modification time of <file> as the build session timestamp">;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits