aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp-mi.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-05-29 16:19:32 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-29 16:19:32 +0000
commitea4a453b8909eb0f3612bbf98fe2e6a2a8ee4114 (patch)
tree05d62231cd71e2302cbbf76f31135f52a6e77ba9 /gcc/testsuite/gcc.dg/cpp-mi.c
parent1b50716d21794f2f69aa2939045fbf1489ff3c19 (diff)
downloadgcc-ea4a453b8909eb0f3612bbf98fe2e6a2a8ee4114.zip
gcc-ea4a453b8909eb0f3612bbf98fe2e6a2a8ee4114.tar.gz
gcc-ea4a453b8909eb0f3612bbf98fe2e6a2a8ee4114.tar.bz2
cpplib.h (cpp_reader): Remove if_stack.
* cpplib.h (cpp_reader): Remove if_stack. Change potential_control_macro to a cpp_hashnode *. Add skipping flag. * cpphash.h (struct ihash): Change control_macro to a cpp_hashnode * and shorten name to cmacro. Add NEVER_REINCLUDE constant. * cppfiles.c (redundant_include_p): Drop cpp_reader argument. Examine the cmacro node directly, no need to call cpp_defined. (_cpp_execute_include, read_include_file): Set cmacro to NEVER_REINCLUDE, not U"". * cpplex.c (cpp_push_buffer): Don't set new->if_stack. (cpp_get_token): If pfile->skipping is true, discard text and keep scanning until we hit a directive; don't expand macros. * cpplib.c (struct if_stack): Remove if_succeeded, add was_skipping. Change control_macro to a cpp_hashnode * and shorten name to cmacro. Remove typedef IF_STACK. (parse_ifdef), detect_if_not_defined): Return a cpp_hashnode *. (conditional_skip, skip_if_group, consider_directive_while_skipping): Delete. (push_conditional): New. (_cpp_handle_directive): Don't process directives other than conditionals if we are skipping. (do_ifdef, do_ifndef, do_if, do_else, do_elif, do_endif): Update to new scheme. (validate_else): Skip rest of line here, unconditionally. (_cpp_unwind_if_stack): The stack is per-buffer. Force pfile->skipping off. (all): Remove `scare quotes' from error messages. * gcc.dg/cpp-mi.c: Add another case, cpp-mix.h, where the guard macro is already defined when the header is first included. * gcc.dg/cpp-mix.h: New file. * gcc.dg/endif-label.c: Update patterns to match compiler. * g++.brendan/complex1.C: Declare abort. * g++.law/refs4.C: Remove XFAIL. * g++.oliva/expr2.C: Declare abort and exit. From-SVN: r34253
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp-mi.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp-mi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-mi.c b/gcc/testsuite/gcc.dg/cpp-mi.c
index a05b279..f83a64d 100644
--- a/gcc/testsuite/gcc.dg/cpp-mi.c
+++ b/gcc/testsuite/gcc.dg/cpp-mi.c
@@ -17,6 +17,10 @@
#include "cpp-mindp.h"
#include "cpp-mindp.h"
+#define CPP_MIX_H
+#include "cpp-mix.h"
+#include "cpp-mix.h"
+
int
main (void)
{
@@ -28,7 +32,7 @@ main (void)
{ dg-final { set tmp [grep cpp-mi.i {cpp-mi.*\.h} line] } }
{ dg-final { # send_user "$tmp\n" } }
- { dg-final { if [regexp "^{\[0-9\]+ cpp-mic\.h} {\[0-9\]+ cpp-micc\.h} {\[0-9\]+ cpp-mind\.h} {\[0-9\]+ cpp-mindp\.h}$" $tmp] \{ } }
+ { dg-final { if [regexp "^{\[0-9\]+ cpp-mic\.h} {\[0-9\]+ cpp-micc\.h} {\[0-9\]+ cpp-mind\.h} {\[0-9\]+ cpp-mindp\.h} {\[0-9]+ cpp-mix\.h}$" $tmp] \{ } }
{ dg-final { pass "cpp-mi.c: redundant include check" } }
{ dg-final { \} else \{ } }
{ dg-final { fail "cpp-mi.c: redundant include check" } }