* a modification time of one of the include files is too new (needed to avoid a
race condition)
* a compiler option not supported by the direct mode is used:
-** a `-Wp,++*++` compiler option other than `-Wp,-MD,<path>`, `-Wp,-MMD,<path>`
- and `-Wp,-D<define>`
+** a `-Wp,++*++` compiler option other than `-Wp,-MD,<path>`, `-Wp,-MMD,<path>`,
+ `-Wp,-D<macro[=defn]>` or `-Wp,-U<macro>`
** `-Xpreprocessor`
* the string `+__TIME__+` is present in the source code
}
state.dep_args.push_back(args[i]);
return Statistic::none;
- } else if (util::starts_with(args[i], "-Wp,-D")
+ } else if ((util::starts_with(args[i], "-Wp,-D")
+ || util::starts_with(args[i], "-Wp,-U"))
&& args[i].find(',', 6) == std::string::npos) {
state.cpp_args.push_back(args[i]);
return Statistic::none;
expect_stat preprocessed_cache_hit 0
expect_stat cache_miss 2
+ # -------------------------------------------------------------------------
+ TEST "-Wp,-U"
+
+ $CCACHE_COMPILE -c -Wp,-UFOO test.c
+ expect_stat direct_cache_hit 0
+ expect_stat preprocessed_cache_hit 0
+ expect_stat cache_miss 1
+
+ $CCACHE_COMPILE -c -Wp,-UFOO test.c
+ expect_stat direct_cache_hit 1
+ expect_stat preprocessed_cache_hit 0
+ expect_stat cache_miss 1
+
# -------------------------------------------------------------------------
TEST "-Wp, with multiple arguments"