From 5845688e91d85d46c0f47daaf4edfdfc772853cf Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 13 Nov 2024 09:34:23 +0100 Subject: Reapply "[clang] Introduce diagnostics suppression mappings (#112517)" This reverts commit 5f140ba54794fe6ca379362b133eb27780e363d7. --- clang/unittests/Frontend/CompilerInvocationTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp') diff --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp index 7912253..45478de 100644 --- a/clang/unittests/Frontend/CompilerInvocationTest.cpp +++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp @@ -1046,4 +1046,15 @@ TEST_F(CommandLineTest, PluginArgsRoundTripDeterminism) { ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags)); } + +TEST_F(CommandLineTest, WarningSuppressionMappings) { + const char *Args[] = {"--warning-suppression-mappings=foo.txt"}; + + EXPECT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags)); + EXPECT_EQ(Invocation.getDiagnosticOpts().DiagnosticSuppressionMappingsFile, + "foo.txt"); + + Invocation.generateCC1CommandLine(GeneratedArgs, *this); + EXPECT_THAT(GeneratedArgs, Contains(StrEq(Args[0]))); +} } // anonymous namespace -- cgit v1.1