summaryrefslogtreecommitdiff
path: root/test/Preprocessor
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
commitc8fbd44eb02d2f3ca6810fe16632096f475c654a (patch)
tree9d958f5d5c3157354c205f804e969998e56b10e6 /test/Preprocessor
parente7fb48466afcbf2c4ccdfa658824282fdc3c512c (diff)
downloadclang-c8fbd44eb02d2f3ca6810fe16632096f475c654a.tar.gz
clang-c8fbd44eb02d2f3ca6810fe16632096f475c654a.tar.bz2
clang-c8fbd44eb02d2f3ca6810fe16632096f475c654a.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor')
-rw-r--r--test/Preprocessor/builtin_line.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/Preprocessor/builtin_line.c b/test/Preprocessor/builtin_line.c
index c9ce558c1a..7698d5f43c 100644
--- a/test/Preprocessor/builtin_line.c
+++ b/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(
+
+)