From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/cpp/dir-only-1.c | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp/dir-only-1.c (limited to 'gcc/testsuite/gcc.dg/cpp/dir-only-1.c') diff --git a/gcc/testsuite/gcc.dg/cpp/dir-only-1.c b/gcc/testsuite/gcc.dg/cpp/dir-only-1.c new file mode 100644 index 000000000..3c2261683 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/dir-only-1.c @@ -0,0 +1,73 @@ +/* Copyright 2007 Free Software Foundation, Inc. + Contributed by Ollie Wild . */ + +/* { dg-do preprocess } */ +/* { dg-options -fdirectives-only } */ + +/* Tests scan_translation_unit_directives_only()'s handling of corner cases. */ + +/* Ignore directives inside block comments... +#error directive inside block comment +*/ + +// Escaped newline doesn't terminate line comment \ +#error directive inside line comment + +/* A comment canot start inside a string. */ +const char *c1 = "/*"; +#define NOT_IN_COMMENT +const char *c2 = "*/"; +#ifndef NOT_IN_COMMENT +#error Comment started inside a string literal +#endif + +/* Escaped newline handling. */ +int i; \ +#error ignored escaped newline + \ + \ +#define BOL +#ifndef BOL +#error escaped newline did not preserve beginning of line +#endif + +/* Handles \\ properly at the end of a string. */ +"string ends in \\"/* +#error Missed string terminator. +*/ + +/* Handles macro expansion in preprocessing directives. */ +#define HEADER "dir-only-1.h" +#include HEADER +#ifndef GOT_HEADER +#error Failed to include header. +#endif + +/\ +* +#define IN_COMMENT +*/ +#ifdef IN_COMMENT +#error Escaped newline breaks block comment initiator. +#endif + +/* +*\ +/ +#define NOT_IN_COMMENT2 +/**/ +#ifndef NOT_IN_COMMENT2 +#error Escaped newline breaks block comment terminator. +#endif + +/* Test escaped newline inside character escape sequence. */ +"\\ +\"/* +#error Missed string terminator +*/ + +/* Block comments don't mask trailing preprocessing + directive. */ #define NOT_MASKED +#ifndef NOT_MASKED +#error Comment masks trailing directive. +#endif -- cgit v1.2.3