Commit 14e2799a by Neil Booth Committed by Neil Booth

* gcc.dg/cpp/avoidpaste1.c: Test case.

From-SVN: r39319
parent 26ec42ee
2001-01-28 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/avoidpaste1.c: Test case.
2001-01-28 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/inline18.C: New test.
......
/* Copyright (C) 2000 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
/* This tests that we avoid accidental pasting only before and after
macros and arguments, and not when the tokens are already pasted
in the souce file (e.g. "::" in a C source file).
Neil Booth, 28 Jan 2001. */
#define f(x) x
#define g
/* This should preprocess as
:: : : : : :^:
: : : .. . 0
It relies on the fact that even preprocessing C we bother to separate
the colons of C++'s :: operator. If we confine this behaviour to C++
in future, this test needs to change. */
:: :g: :f(): :f(^):
:f(:): .. .__INCLUDE_LEVEL__ /* Check builtins, too. */
/*
{ dg-final { if ![file exists avoidpaste1.i] { return } } }
{ dg-final { if { [grep avoidpaste1.i ":: : : : : :\\^:"] != "" } \{ } }
{ dg-final { if { [grep avoidpaste1.i ": : : \\\.\\\. \\\. 0"] != "" } \{ } }
{ dg-final { return \} \} } }
{ dg-final { fail "avoidpaste1.c: paste avoidance" } }
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment