substring_loc info needs default track-macro-expansion (PR preprocessor/78324)
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 21 Nov 2016 15:50:38 +0000 (15:50 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 21 Nov 2016 15:50:38 +0000 (15:50 +0000)
commit67b5d0b2fe8cdb72dfc56644e42c28f453cb2f76
treee310cae0dff43fc2c619bb7bf0b1a055a547085e
parentdd586f9814de2a14a90ef915f91f74144757e256
substring_loc info needs default track-macro-expansion (PR preprocessor/78324)

gcc/ChangeLog:
PR preprocessor/78324
* input.c (get_substring_ranges_for_loc): Fail gracefully if
-ftrack-macro-expansion has a value other than 2.

gcc/testsuite/ChangeLog:
PR preprocessor/78324
* gcc.dg/plugin/diagnostic-test-string-literals-1.c
(test_multitoken_macro): New function.
* gcc.dg/plugin/diagnostic-test-string-literals-3.c: New test
case.
* gcc.dg/plugin/diagnostic-test-string-literals-4.c: New test
case.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new test
cases.
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c (test_sprintf_note):
Move to...
* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: ...here.  Drop
-ftrack-macro-expansion=0.
(test_sprintf_note): Remove "P" macro.  Add
dg-begin/end-multiline-output directives.
(LINE, buffer, ptr): Copy from builtin-sprintf-warn-1.c.

From-SVN: r242667
gcc/ChangeLog
gcc/input.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c
gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/plugin/plugin.exp
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-4.c