return Statistic::none;
}
- if (config.is_compiler_group_msvc() && util::starts_with(arg, "-Z")) {
+ if (config.is_compiler_group_msvc() && !config.is_compiler_group_clang()
+ && util::starts_with(arg, "-Z")) {
state.last_seen_msvc_z_option = args[i];
state.common_args.push_back(args[i]);
return Statistic::none;
}
}
+// Check that clang-cl debug information is parsed different,
+// since for clang-cl /Zi and /Z7 is the same!
+TEST_CASE("ClangCL Debug information options")
+{
+ TestContext test_context;
+ Context ctx;
+ ctx.config.set_compiler_type(CompilerType::clang_cl);
+ util::write_file("foo.c", "");
+
+ SUBCASE("/Z7")
+ {
+ ctx.orig_args = Args::from_string("clang-cl.exe /c foo.c /Z7");
+ const ProcessArgsResult result = process_args(ctx);
+ REQUIRE(!result.error);
+ CHECK(result.preprocessor_args.to_string() == "clang-cl.exe /Z7");
+ }
+
+ SUBCASE("/Zi")
+ {
+ ctx.orig_args = Args::from_string("clang-cl.exe /c foo.c /Zi");
+ const ProcessArgsResult result = process_args(ctx);
+ REQUIRE(!result.error);
+ CHECK(result.preprocessor_args.to_string() == "clang-cl.exe /Zi");
+ }
+}
+
TEST_SUITE_END();