[cfe-commits] r64603 - /cfe/trunk/test/Preprocessor/builtin_line.c

Chris Lattner sabre at nondot.org
Sun Feb 15 13:06:15 PST 2009


Author: lattner
Date: Sun Feb 15 15:06:15 2009
New Revision: 64603

URL: http://llvm.org/viewvc/llvm-project?rev=64603&view=rev
Log:
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.

Modified:
    cfe/trunk/test/Preprocessor/builtin_line.c

Modified: cfe/trunk/test/Preprocessor/builtin_line.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/builtin_line.c?rev=64603&r1=64602&r2=64603&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/builtin_line.c (original)
+++ cfe/trunk/test/Preprocessor/builtin_line.c Sun Feb 15 15:06:15 2009
@@ -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(
+
+)





More information about the cfe-commits mailing list