summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-17 23:30:53 +0000
committerChris Lattner <sabre@nondot.org>2009-04-17 23:30:53 +0000
commit0003c27f5e7d19b4069a098a33b14674c39dccb2 (patch)
treed0dfadde5567cad1fa70b19611d294e3c026534e /clang/test/Preprocessor
parent06684350c4428df2d18fce93e8b68379da9798dc (diff)
downloadbcm5719-llvm-0003c27f5e7d19b4069a098a33b14674c39dccb2.tar.gz
bcm5719-llvm-0003c27f5e7d19b4069a098a33b14674c39dccb2.zip
#line is allowed to have macros that expand to nothing after them.
llvm-svn: 69401
Diffstat (limited to 'clang/test/Preprocessor')
-rw-r--r--clang/test/Preprocessor/line-directive.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/line-directive.c b/clang/test/Preprocessor/line-directive.c
index 66efae94d5c..1dd8b292d2e 100644
--- a/clang/test/Preprocessor/line-directive.c
+++ b/clang/test/Preprocessor/line-directive.c
@@ -60,3 +60,11 @@ typedef int z1; // ok
typedef int w; // expected-note {{previous definition is here}}
typedef int w; // expected-error {{redefinition of typedef 'w' is invalid in C}}
+
+
+// This should not produce an "extra tokens at end of #line directive" warning,
+// because #line is allowed to contain expanded tokens.
+#define EMPTY()
+#line 2 "foo.c" EMPTY( )
+#line 2 "foo.c" NONEMPTY( ) // expected-warning{{extra tokens at end of #line directive}}
+
OpenPOWER on IntegriCloud