diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/spacing1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/spacing1.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/spacing1.c b/gcc/testsuite/gcc.dg/cpp/spacing1.c index ad1af4e91c7..b7e713ba333 100644 --- a/gcc/testsuite/gcc.dg/cpp/spacing1.c +++ b/gcc/testsuite/gcc.dg/cpp/spacing1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. */ +/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ @@ -10,6 +10,15 @@ Neil Booth, 1 Dec 2000, 23 Sep 2001. */ +/* The actual location of the expansion of a multi-line macro + invocation is not defined: we might consider them to be in the same + line as the initial token of the invocation, or as the final token + of the invocation, or even anything in between. We choose to make + it the initial token, such that everything that is in a logical + line ends up in a single line after preprocessing. + + Alexandre Oliva, Sept 13, 2003. */ + #define str(x) #x #define f(x) x #define glue(x, y) x ## y @@ -28,6 +37,8 @@ B Q B Q A Q A: f bar +A +bad g "1 2" bam baz */ @@ -36,6 +47,8 @@ glue (EMPTY 4, 4) EMPTY; A(Q) C(Q) D()Q D(): f bar +A +bad f (g) str ( 1 @@ -49,7 +62,9 @@ f (g) str { dg-final { if \{ [grep spacing1.i "B Q B Q A Q A:"] != "" \} \{ } } { dg-final { if \{ [grep spacing1.i "f.*bar"] == "" \} \{ } } { dg-final { if \{ [grep spacing1.i "^bar"] != "" \} \{ } } + { dg-final { if \{ [grep spacing1.i "^A$"] != "" \} \{ } } + { dg-final { if \{ [grep spacing1.i "^bad$"] != "" \} \{ } } { dg-final { if \{ [grep spacing1.i "g \"1 2\" bam baz"] != "" \} \{ } } - { dg-final { return \} \} \} \} \} } } + { dg-final { return \} \} \} \} \} \} \} } } { dg-final { fail "spacing1.c: spacing and new-line preservation" } } */ |