From: Jakub Jelinek Date: Mon, 13 Jun 2016 21:00:07 +0000 (+0200) Subject: re PR preprocessor/71183 (gcc -E always gives __DATE__ and __TIME__ as Jan 1 1970... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef7cf206b6f9fd93ac41393829f79164b8adad1b;p=gcc.git re PR preprocessor/71183 (gcc -E always gives __DATE__ and __TIME__ as Jan 1 1970 00:00:00) PR preprocessor/71183 * c-ppoutput.c (init_pp_output): Set cb->get_source_date_epoch to cb_get_source_date_epoch. * gcc.dg/cpp/source_date_epoch-3.c: New test. From-SVN: r237408 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index a53fc9cceb5..69ba05ca49f 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2016-06-13 Jakub Jelinek + + PR preprocessor/71183 + * c-ppoutput.c (init_pp_output): Set cb->get_source_date_epoch + to cb_get_source_date_epoch. + 2016-06-10 Jakub Jelinek PR c/68657 diff --git a/gcc/c-family/c-ppoutput.c b/gcc/c-family/c-ppoutput.c index cc433c9a40b..1f812a55f88 100644 --- a/gcc/c-family/c-ppoutput.c +++ b/gcc/c-family/c-ppoutput.c @@ -150,6 +150,7 @@ init_pp_output (FILE *out_stream) } cb->has_attribute = c_common_has_attribute; + cb->get_source_date_epoch = cb_get_source_date_epoch; /* Initialize the print structure. */ print.src_line = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6ba9050d166..33ff1268159 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-13 Jakub Jelinek + + PR preprocessor/71183 + * gcc.dg/cpp/source_date_epoch-3.c: New test. + 2016-06-13 Jeff Law PR tree-optimization/71403 diff --git a/gcc/testsuite/gcc.dg/cpp/source_date_epoch-3.c b/gcc/testsuite/gcc.dg/cpp/source_date_epoch-3.c new file mode 100644 index 00000000000..95a105bb071 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/source_date_epoch-3.c @@ -0,0 +1,9 @@ +/* PR preprocessor/71183 */ +/* { dg-do preprocess } */ +/* { dg-set-compiler-env-var SOURCE_DATE_EPOCH "630333296" } */ + +const char *date = __DATE__; +const char *time = __TIME__; + +/* { dg-final { scan-file source_date_epoch-3.i "Dec 22 1989" } } */ +/* { dg-final { scan-file source_date_epoch-3.i "12:34:56" } } */