From: Joel Rosdahl Date: Sun, 8 Jan 2012 12:28:27 +0000 (+0100) Subject: Merge branch 'maint' X-Git-Tag: v3.2~168^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0e89a4565147f77d930fcff06a39d4804c73e7ec;p=thirdparty%2Fccache.git Merge branch 'maint' * maint: Update NEWS Also recognize -specs=file in addition to --specs=file Revert GCC bug compatibility for -MTarg and -MQarg Fix minor memory leaks Correct log message when unify mode is enabled Hash environment variables that affect the preprocessor output Hash mtime or content of GCC plugins specified with -fplugin= Use hash_compiler for explicit --specs= options as well Refactor code into a hash_compiler function Improve description on how to fix bad object files in the cache Make failure to create files in cache fatal Make failure to create cache directories fatal Remove unused print_executed_command function Handle non-writable CCACHE_DIR gracefully Conflicts: ccache.c test.sh test/test_argument_processing.c --- 0e89a4565147f77d930fcff06a39d4804c73e7ec diff --cc test/test_argument_processing.c index 18dcaea45,94e46f4ff..dcdbb1238 --- a/test/test_argument_processing.c +++ b/test/test_argument_processing.c @@@ -201,8 -202,9 +201,8 @@@ TEST(MQ_flag_with_immediate_argument_sh struct args *orig = args_init_from_string( "gcc -c -MD -MP -MFfoo.d -MQfoo.d foo.c"); struct args *exp_cpp = args_init_from_string( - "gcc -MD -MP -MFfoo.d -MQfoo.d -MQ foo.o"); - "gcc -c -MD -MP -MFfoo.d -MQfoo.d"); - struct args *exp_cc = args_init_from_string( - "gcc -c"); ++ "gcc -MD -MP -MFfoo.d -MQfoo.d"); + struct args *exp_cc = args_init_from_string("gcc -c"); struct args *act_cpp = NULL, *act_cc = NULL; create_file("foo.c", ""); @@@ -218,35 -220,11 +218,35 @@@ TEST(MT_flag_with_immediate_argument_sh struct args *orig = args_init_from_string( "gcc -c -MD -MP -MFfoo.d -MTfoo.d foo.c"); struct args *exp_cpp = args_init_from_string( - "gcc -MD -MP -MFfoo.d -MTfoo.d -MQ foo.o"); - "gcc -c -MD -MP -MFfoo.d -MTfoo.d"); - struct args *exp_cc = args_init_from_string( - "gcc -c"); ++ "gcc -MD -MP -MFfoo.d -MTfoo.d"); + struct args *exp_cc = args_init_from_string("gcc -c"); + struct args *act_cpp = NULL, *act_cc = NULL; + create_file("foo.c", ""); + + CHECK(cc_process_args(orig, &act_cpp, &act_cc)); + CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp); + CHECK_ARGS_EQ_FREE12(exp_cc, act_cc); + + args_free(orig); +} + +TEST(fprofile_flag_with_existing_dir_should_be_rewritten_to_real_path) +{ + struct args *orig = args_init_from_string( + "gcc -c -fprofile-generate=some/dir foo.c"); + struct args *exp_cpp = args_init_from_string("gcc"); + struct args *exp_cc = args_init_from_string("gcc"); struct args *act_cpp = NULL, *act_cc = NULL; + char *s; + create_file("foo.c", ""); + mkdir("some", 0777); + mkdir("some/dir", 0777); + s = format("-fprofile-generate=%s", x_realpath("some/dir")); + args_add(exp_cpp, s); + args_add(exp_cc, s); + args_add(exp_cc, "-c"); + free(s); CHECK(cc_process_args(orig, &act_cpp, &act_cc)); CHECK_ARGS_EQ_FREE12(exp_cpp, act_cpp);