[cfe-commits] r38741 - in /cfe/cfe/trunk/test/Preprocessor: macro_paste_hashhash.c macro_rescan.c
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:24:15 PDT 2007
Author: sabre
Date: Wed Jul 11 11:24:15 2007
New Revision: 38741
URL: http://llvm.org/viewvc/llvm-project?rev=38741&view=rev
Log:
new testcase
Added:
cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c (with props)
cfe/cfe/trunk/test/Preprocessor/macro_rescan.c (with props)
Added: cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c?rev=38741&view=auto
==============================================================================
--- cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c (added)
+++ cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c Wed Jul 11 11:24:15 2007
@@ -0,0 +1,7 @@
+// RUN: clang -E %s | grep '^"x ## y";$'
+#define hash_hash # ## #
+#define mkstr(a) # a
+#define in_between(a) mkstr(a)
+#define join(c, d) in_between(c hash_hash d)
+join(x, y);
+
Propchange: cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/cfe/trunk/test/Preprocessor/macro_paste_hashhash.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: cfe/cfe/trunk/test/Preprocessor/macro_rescan.c
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/test/Preprocessor/macro_rescan.c?rev=38741&view=auto
==============================================================================
--- cfe/cfe/trunk/test/Preprocessor/macro_rescan.c (added)
+++ cfe/cfe/trunk/test/Preprocessor/macro_rescan.c Wed Jul 11 11:24:15 2007
@@ -0,0 +1,9 @@
+// RUN: clang -E %s | grep 'ei_1 = (17+1);' &&
+// RUN: clang -E %s | grep 'ei_2 = (M1)(17);'
+
+#define M1(a) (a+1)
+#define M2(b) b
+
+int ei_1 = M2(M1)(17); /* becomes int ei_1 = (17+1); */
+int ei_2 = (M2(M1))(17); /* becomes int ei_2 = (M1)(17); */
+
Propchange: cfe/cfe/trunk/test/Preprocessor/macro_rescan.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/cfe/trunk/test/Preprocessor/macro_rescan.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
More information about the cfe-commits
mailing list