https://gcc.gnu.org/g:42028a9d8b19672e78bdcc3797a042b5ea226bc8

commit r16-4404-g42028a9d8b19672e78bdcc3797a042b5ea226bc8
Author: Eric Botcazou <[email protected]>
Date:   Tue Oct 14 00:24:37 2025 +0200

    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.

Diff:
---
 gcc/testsuite/gcc.dg/cpp/cpp.exp    |  8 ++++----
 gcc/testsuite/gcc.dg/cpp/escape-3.i | 16 ++++++++++++++++
 gcc/testsuite/gcc.dg/cpp/pr36674.i  |  2 +-
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp
index 7a359c050e4c..754ffebf9f96 100644
--- a/gcc/testsuite/gcc.dg/cpp/cpp.exp
+++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp
@@ -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 " ""
 
 
diff --git a/gcc/testsuite/gcc.dg/cpp/escape-3.i 
b/gcc/testsuite/gcc.dg/cpp/escape-3.i
new file mode 100644
index 000000000000..6eb7dc4b2708
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/escape-3.i
@@ -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" } } } */
diff --git a/gcc/testsuite/gcc.dg/cpp/pr36674.i 
b/gcc/testsuite/gcc.dg/cpp/pr36674.i
index 9362d5a40808..f43628772399 100644
--- a/gcc/testsuite/gcc.dg/cpp/pr36674.i
+++ b/gcc/testsuite/gcc.dg/cpp/pr36674.i
@@ -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>"

Reply via email to