diff --git a/gcc/testsuite/gcc.dg/cpp/normalize-3.c b/gcc/testsuite/c-c++-common/cpp/normalize-3.c similarity index 88% rename from gcc/testsuite/gcc.dg/cpp/normalize-3.c rename to gcc/testsuite/c-c++-common/cpp/normalize-3.c index a4f496fbb3a..ae0184cfbb0 100644 --- a/gcc/testsuite/gcc.dg/cpp/normalize-3.c +++ b/gcc/testsuite/c-c++-common/cpp/normalize-3.c @@ -1,5 +1,6 @@ /* { dg-do preprocess } */ -/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=id" } */ +/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=id" { target c } } */ +/* { dg-options "-fextended-identifiers -Wnormalized=id" { target c++ } } */ \u00AA \u00B7 diff --git a/gcc/testsuite/c-c++-common/cpp/warning-directive-1.c b/gcc/testsuite/c-c++-common/cpp/warning-directive-1.c new file mode 100644 index 00000000000..e23d240c2f7 --- /dev/null +++ b/gcc/testsuite/c-c++-common/cpp/warning-directive-1.c @@ -0,0 +1,4 @@ +// { dg-do preprocess } +// { dg-options "-std=gnu99 -fdiagnostics-show-option" { target c } } +// { dg-options "-fdiagnostics-show-option" { target c++ } } +#warning "Printed" // { dg-warning "\"Printed\" .-Wcpp." } diff --git a/gcc/testsuite/gcc.dg/cpp/warning-directive-2.c b/gcc/testsuite/c-c++-common/cpp/warning-directive-2.c similarity index 71% rename from gcc/testsuite/gcc.dg/cpp/warning-directive-2.c rename to gcc/testsuite/c-c++-common/cpp/warning-directive-2.c index 753b84a692e..15c74d2baa4 100644 --- a/gcc/testsuite/gcc.dg/cpp/warning-directive-2.c +++ b/gcc/testsuite/c-c++-common/cpp/warning-directive-2.c @@ -1,4 +1,5 @@ // { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=cpp" } +// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=cpp" { target c } } +// { dg-options "-fdiagnostics-show-option -Werror=cpp" { target c++ } } /* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ #warning "Printed" // { dg-error "\"Printed\" .-Wcpp." } diff --git a/gcc/testsuite/gcc.dg/cpp/warning-directive-3.c b/gcc/testsuite/c-c++-common/cpp/warning-directive-3.c similarity index 56% rename from gcc/testsuite/gcc.dg/cpp/warning-directive-3.c rename to gcc/testsuite/c-c++-common/cpp/warning-directive-3.c index 48c97f3ac5b..0c50a318df6 100644 --- a/gcc/testsuite/gcc.dg/cpp/warning-directive-3.c +++ b/gcc/testsuite/c-c++-common/cpp/warning-directive-3.c @@ -1,4 +1,4 @@ // { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror -Wno-error=cpp" } - +// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror -Wno-error=cpp" { target c } } +// { dg-options "-fdiagnostics-show-option -Werror -Wno-error=cpp" { target c++ } } #warning "Printed" // { dg-warning "\"Printed\" .-Wcpp." } diff --git a/gcc/testsuite/gcc.dg/cpp/warning-directive-4.c b/gcc/testsuite/c-c++-common/cpp/warning-directive-4.c similarity index 60% rename from gcc/testsuite/gcc.dg/cpp/warning-directive-4.c rename to gcc/testsuite/c-c++-common/cpp/warning-directive-4.c index 2eb101765da..23069f8ade2 100644 --- a/gcc/testsuite/gcc.dg/cpp/warning-directive-4.c +++ b/gcc/testsuite/c-c++-common/cpp/warning-directive-4.c @@ -1,4 +1,4 @@ // { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wno-cpp" } - +// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wno-cpp" { target c } } +// { dg-options "-fdiagnostics-show-option -Wno-cpp" { target c++ } } #warning "Not printed" // { dg-bogus "." } diff --git a/gcc/testsuite/g++.dg/cpp/normalize-1.C b/gcc/testsuite/g++.dg/cpp/normalize-1.C deleted file mode 100644 index 536a3b45b98..00000000000 --- a/gcc/testsuite/g++.dg/cpp/normalize-1.C +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-fextended-identifiers -Wnormalized=id" } */ - -\u00AA -\u00B7 -\u0F43 /* { dg-warning "not in NFC" } */ -a\u05B8\u05B9\u05B9\u05BBb - a\u05BB\u05B9\u05B8\u05B9b /* { dg-warning "not in NFC" } */ -\u09CB -\u09C7\u09BE /* { dg-warning "not in NFC" } */ -\u0B4B -\u0B47\u0B3E /* { dg-warning "not in NFC" } */ -\u0BCA -\u0BC6\u0BBE /* { dg-warning "not in NFC" } */ -\u0BCB -\u0BC7\u0BBE /* { dg-warning "not in NFC" } */ -\u0CCA -\u0CC6\u0CC2 /* { dg-warning "not in NFC" } */ -\u0D4A -\u0D46\u0D3E /* { dg-warning "not in NFC" } */ -\u0D4B -\u0D47\u0D3E /* { dg-warning "not in NFC" } */ - -K -\u212A - -\u03AC -\u1F71 /* { dg-warning "not in NFC" } */ - -\uAC00 -\u1100\u1161 -\uAC01 -\u1100\u1161\u11A8 -\uAC00\u11A8 diff --git a/gcc/testsuite/g++.dg/cpp/warning-directive-1.C b/gcc/testsuite/g++.dg/cpp/warning-directive-1.C deleted file mode 100644 index 1ce18c6e2c6..00000000000 --- a/gcc/testsuite/g++.dg/cpp/warning-directive-1.C +++ /dev/null @@ -1,4 +0,0 @@ -// { dg-do preprocess } -// { dg-options "-fdiagnostics-show-option" } - -#warning "Printed" // { dg-warning "\"Printed\" .-Wcpp." } diff --git a/gcc/testsuite/g++.dg/cpp/warning-directive-2.C b/gcc/testsuite/g++.dg/cpp/warning-directive-2.C deleted file mode 100644 index c2efc172abe..00000000000 --- a/gcc/testsuite/g++.dg/cpp/warning-directive-2.C +++ /dev/null @@ -1,4 +0,0 @@ -// { dg-do preprocess } -// { dg-options "-fdiagnostics-show-option -Werror=cpp" } -/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */ -#warning "Printed" // { dg-error "\"Printed\" .-Wcpp." } diff --git a/gcc/testsuite/g++.dg/cpp/warning-directive-3.C b/gcc/testsuite/g++.dg/cpp/warning-directive-3.C deleted file mode 100644 index 8ed66c66f1d..00000000000 --- a/gcc/testsuite/g++.dg/cpp/warning-directive-3.C +++ /dev/null @@ -1,4 +0,0 @@ -// { dg-do preprocess } -// { dg-options "-fdiagnostics-show-option -Werror -Wno-error=cpp" } - -#warning "Printed" // { dg-warning "\"Printed\" .-Wcpp." } diff --git a/gcc/testsuite/g++.dg/cpp/warning-directive-4.C b/gcc/testsuite/g++.dg/cpp/warning-directive-4.C deleted file mode 100644 index a5db1b4d5cd..00000000000 --- a/gcc/testsuite/g++.dg/cpp/warning-directive-4.C +++ /dev/null @@ -1,4 +0,0 @@ -// { dg-do preprocess } -// { dg-options "-fdiagnostics-show-option -Wno-cpp" } - -#warning "Not printed" // { dg-bogus "." } diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp index 2642da12301..5758218a267 100644 --- a/gcc/testsuite/g++.dg/dg.exp +++ b/gcc/testsuite/g++.dg/dg.exp @@ -55,5 +55,9 @@ dg-runtest $tests "" $DEFAULT_CXXFLAGS dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/*.\[cSi\]]] \ "" "" +dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cpp/*.\[cS\]]] \ + "" "" + + # All done. dg-finish diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp index acf0898407b..311223ff1f7 100644 --- a/gcc/testsuite/gcc.dg/cpp/cpp.exp +++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp @@ -39,5 +39,10 @@ dg-init dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \ "" $DEFAULT_CFLAGS +# C/C++ common tests. +dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cpp/*.{c,S} ]] \ + " -Wc++-compat " "" + + # All done. dg-finish diff --git a/gcc/testsuite/gcc.dg/cpp/warning-directive-1.c b/gcc/testsuite/gcc.dg/cpp/warning-directive-1.c deleted file mode 100644 index cb4bd326cc2..00000000000 --- a/gcc/testsuite/gcc.dg/cpp/warning-directive-1.c +++ /dev/null @@ -1,4 +0,0 @@ -// { dg-do preprocess } -// { dg-options "-std=gnu99 -fdiagnostics-show-option" } - -#warning "Printed" // { dg-warning "\"Printed\" .-Wcpp." }