]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libcpp: decode original directory strings for traditional CPP
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 13 Oct 2025 22:24:37 +0000 (00:24 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 13 Oct 2025 22:24:37 +0000 (00:24 +0200)
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.

gcc/testsuite/gcc.dg/cpp/cpp.exp
gcc/testsuite/gcc.dg/cpp/escape-3.i [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/pr36674.i

index 7a359c050e4c5c0e649391101d88aa60bd50a01e..754ffebf9f96779a81696aeca8c629ae28d4635b 100644 (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 " ""
 
 
diff --git a/gcc/testsuite/gcc.dg/cpp/escape-3.i b/gcc/testsuite/gcc.dg/cpp/escape-3.i
new file mode 100644 (file)
index 0000000..6eb7dc4
--- /dev/null
@@ -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" } } } */
index 9362d5a408084045b719cf837a0cacc37305f59d..f43628772399cfad3540d219b1e842229536751f 100644 (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>"