summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/builtin_line.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-15 21:06:15 +0000
committerChris Lattner <sabre@nondot.org>2009-02-15 21:06:15 +0000
commit2edf0fcb7508dcca7389a7969cb7a93dfbdfbd50 (patch)
tree8c827e642f574ea1436c045cc0ab7a346f3f300c /clang/test/Preprocessor/builtin_line.c
parent9dc9c206d3a2b2a35e5a9dfd407c1741bcee9ecf (diff)
downloadbcm5719-llvm-2edf0fcb7508dcca7389a7969cb7a93dfbdfbd50.tar.gz
bcm5719-llvm-2edf0fcb7508dcca7389a7969cb7a93dfbdfbd50.zip
fix PR3579: __LINE__ expands to the presumed location of the
*end* of a macro instantiation, not the start of it. This is really all about bug-for-bug compatibility with GCC, but not doing this breaks the FreeBSD kernel. llvm-svn: 64603
Diffstat (limited to 'clang/test/Preprocessor/builtin_line.c')
-rw-r--r--clang/test/Preprocessor/builtin_line.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/Preprocessor/builtin_line.c b/clang/test/Preprocessor/builtin_line.c
index c9ce558c1ab..7698d5f43c4 100644
--- a/clang/test/Preprocessor/builtin_line.c
+++ b/clang/test/Preprocessor/builtin_line.c
@@ -1,4 +1,13 @@
-// RUN: clang %s -E | grep "^ 4"
+// RUN: clang %s -E | grep "^ 4" &&
#define FOO __LINE__
FOO
+
+// PR3579 - This should expand to the __LINE__ of the ')' not of the X.
+// RUN: clang %s -E | grep "^A 13"
+
+#define X() __LINE__
+
+A X(
+
+)
OpenPOWER on IntegriCloud