diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/paste11.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/paste11.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/paste11.c b/gcc/testsuite/gcc.dg/cpp/paste11.c new file mode 100644 index 000000000..e3860ebb7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/paste11.c @@ -0,0 +1,15 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* Test correct pasting of identifiers and numbers. We can paste any + number, as long as no '.', '-' or '+' appears in its spelling. */ + +#define glue(x, y) x ## y + +glue (ident, 12) /* OK. */ +glue (ident, 12e3) /* OK. */ +glue (ident, 12e+3) /* { dg-error "valid preprocessing tok" } */ +glue (ident, 12e-3) /* { dg-error "valid preprocessing tok" } */ +glue (ident, 1.2) /* { dg-error "valid preprocessing tok" } */ +glue (ident, .12) /* { dg-error "valid preprocessing tok" } */ |