Commit ef7cf206 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 755fa666
2016-06-13 Jakub Jelinek <jakub@redhat.com>
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 <jakub@redhat.com> 2016-06-10 Jakub Jelinek <jakub@redhat.com>
PR c/68657 PR c/68657
......
...@@ -150,6 +150,7 @@ init_pp_output (FILE *out_stream) ...@@ -150,6 +150,7 @@ init_pp_output (FILE *out_stream)
} }
cb->has_attribute = c_common_has_attribute; cb->has_attribute = c_common_has_attribute;
cb->get_source_date_epoch = cb_get_source_date_epoch;
/* Initialize the print structure. */ /* Initialize the print structure. */
print.src_line = 1; print.src_line = 1;
......
2016-06-13 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/71183
* gcc.dg/cpp/source_date_epoch-3.c: New test.
2016-06-13 Jeff Law <law@redhat.com> 2016-06-13 Jeff Law <law@redhat.com>
PR tree-optimization/71403 PR tree-optimization/71403
......
/* 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment