Add test coverage for _Pragma (PR preprocessor 69126, 69543, 69558)
commitd5bf2cc892f85286f6b12b34aa363d0b4b1944e8
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Feb 2016 17:39:16 +0000 (23 17:39 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Feb 2016 17:39:16 +0000 (23 17:39 +0000)
tree2b0e5b41b39ca244918d39ae1b70451ff04f3ed9
parent1347328823fba58215ae16afe5b409ae18ca3abd
Add test coverage for _Pragma (PR preprocessor 69126, 69543, 69558)

We had some regressions in the ability for _Pragma to disable a warning
(PR preprocessor/69126, PR preprocessor/69543, PR preprocessor/69558).

This patch attempts to add more test coverage for this, for the
various combinations of:
  - various warnings:
    -Wunused-variable
    -Wuninitialized
    -Wdeprecated-declarations
  - various combinations of location of _Pragma relative to location of
    the warning:
     - _Pragma is in a macro, warning isn't a macro
     - neither is in a macro
     - _Pragma isnt't in a macro, warning is in a macro
     - in different macros
     - both in the same macro
  - C vs C++ frontend.

It adds some XFAILs:
  - pr69543-1.c for C++ (fixed in the followup patch)
  - pr69543-3.c for both C and C++
  - pr69543-4.c for both C and C++
  - pr69558.c for C++ (moving it from gcc.dg to c-c++-common,
    marking it as xfail for C++ for now)

gcc/testsuite/ChangeLog:
PR preprocessor/69126
PR preprocessor/69543
PR preprocessor/69558
* c-c++-common/pr69126.c (MACRO_1, test_1): New.
(f): Rename to...
(test_2): ...this, and add leading comment.
(MACRO_3, test_3): New.
(MACRO_4A, MACRO_4B, test_4): New.
(MACRO): Rename to...
(MACRO_5): ...this.
(g): Rename to...
(test_5): ...this, updating for renaming of MACRO, and
add leading comment.
* c-c++-common/pr69543-1.c: New.
* c-c++-common/pr69543-2.c: New.
* c-c++-common/pr69543-3.c: New.
* c-c++-common/pr69543-4.c: New.
* c-c++-common/pr69558-1.c: New.
* c-c++-common/pr69558-2.c: New.
* c-c++-common/pr69558-3.c: New.
* c-c++-common/pr69558-4.c: New.
* gcc.dg/pr69558.c: Move to...
* c-c++-common/pr69558.c: ...here.  Add dg-bogus directives, with
xfail for c++.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233637 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr69126.c
gcc/testsuite/c-c++-common/pr69543-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr69543-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr69543-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr69543-4.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr69558-1.c [copied from gcc/testsuite/gcc.dg/pr69558.c with 55% similarity]
gcc/testsuite/c-c++-common/pr69558-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr69558-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr69558-4.c [copied from gcc/testsuite/gcc.dg/pr69558.c with 54% similarity]
gcc/testsuite/c-c++-common/pr69558.c [moved from gcc/testsuite/gcc.dg/pr69558.c with 56% similarity]