On 06/09/2016 03:58 PM, David Malcolm wrote:
input.c's selftest::test_reading_source_line attempted to read from
__FILE__, which doesn't work if the binary is run from a different
location than the build dir.

Fix it by rewriting the test to write out a tempfile, and read from
that, rather than from __FILE__.

I used make_temp_file to create the name for the temporary file, on
the grounds that that's what the driver uses for that purpose.

This is on top of the patch kit posted as:
  https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00735.html

Successfully bootstrapped&regretested on x86_64-pc-linux-gnu
Successful -fself-test of stage1 on powerpc-ibm-aix7.1.3.0

OK for trunk?

gcc/ChangeLog:
        PR bootstrap/71481
        * input.c (selftest::test_reading_source_line): Avoid reading from
        __FILE__ by creating a tempfile with known content and reading
        from that instead.
OK.

FWIW, I think the LANG_C vs translating is your call to make. I can see arguments for both directions.

Jeff

Reply via email to