libcpp: decode original directory strings for traditional CPP

gcc/testsuite/
	* gcc.dg/cpp/cpp.exp: Process .i files.
	* gcc.dg/cpp/pr36674.i: Pass -Wno-implicit-int.
	* gcc.dg/cpp/escape-3.i: New test.
This commit is contained in:
Eric Botcazou 2025-10-14 00:24:37 +02:00
parent be496fd2aa
commit 42028a9d8b
3 changed files with 21 additions and 5 deletions

View File

@ -4,12 +4,12 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
@ -36,11 +36,11 @@ if ![info exists DEFAULT_CFLAGS] then {
dg-init
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S,i} ]] \
"" $DEFAULT_CFLAGS
# C/C++ common tests.
dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cpp/*.{c,S} ]] \
dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cpp/*.{c,S,i} ]] \
" -Wc++-compat " ""

View File

@ -0,0 +1,16 @@
# 0 "escape-3.c"
# 0 "/some\\directory//"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "escape-3.c"
/* { dg-do compile } */
/* { dg-options "-g1" } */
int foo (int a, int b)
{
return a + b;
}
/* Test for "/some\\directory" instead of "/some\\\\directory" */
/* { dg-final { scan-assembler { "/some\\\\directory" } } } */

View File

@ -1,6 +1,6 @@
/* PR cpp/36674 #include location is offset by one row in errors from preprocessed files */
/* { dg-do compile } */
/* { dg-options "-fshow-column" } */
/* { dg-options "-fshow-column -Wno-implicit-int" } */
# 1 "gcc/testsuite/gcc.dg/pr36674.c"
# 1 "<built-in>"
# 1 "<command-line>"