diff --git a/pw_preprocessor/compiler_test.cc b/pw_preprocessor/compiler_test.cc index 1216d1c499..2a270bb0af 100644 --- a/pw_preprocessor/compiler_test.cc +++ b/pw_preprocessor/compiler_test.cc @@ -46,5 +46,15 @@ TEST(CompilerMacros, ModifyDiagnostics) { PW_MODIFY_DIAGNOSTICS_POP(); } +TEST(CompilerMacros, ModifyDiagnosticsClangGcc) { + PW_MODIFY_DIAGNOSTICS_PUSH(); + PW_MODIFY_DIAGNOSTIC_GCC(ignored, "-Wunused-variable"); + PW_MODIFY_DIAGNOSTIC_CLANG(ignored, "-Wunused-variable"); + + int this_variable_also_is_unused; + + PW_MODIFY_DIAGNOSTICS_POP(); +} + } // namespace } // namespace pw::preprocessor