arg = argv[i + 1];
i++;
} else {
- // -MFarg
+ // -MFarg or -MF=arg (EDG-based compilers)
arg = &argv[i][3];
+ if (arg[0] == '=') {
+ ++arg;
+ }
}
output_dep = make_relative_path(x_strdup(arg));
// Keep the format of the args the same.
args_free(orig);
}
+TEST(equal_sign_after_MF_should_be_removed)
+{
+ struct args* orig = args_init_from_string("cc -c -MF=path foo.c -o foo.o");
+ struct args* exp_cpp = args_init_from_string("cc -MFpath");
+ struct args* exp_cc = args_init_from_string("cc -c");
+ struct args *act_cpp = NULL, *act_cc = NULL;
+ create_file("foo.c", "");
+
+ CHECK(cc_process_args(orig, &act_cpp, NULL, &act_cc));
+ CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);
+ CHECK_ARGS_EQ_FREE12(exp_cc, act_cc);
+
+ args_free(orig);
+}
+
TEST(sysroot_should_be_rewritten_if_basedir_is_used)
{
extern char* current_working_dir;