r176152 - Add a test to make sure __has_include works from inside a macro.

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Feb 26 17:34:48 PST 2013


Author: akirtzidis
Date: Tue Feb 26 19:34:48 2013
New Revision: 176152

URL: http://llvm.org/viewvc/llvm-project?rev=176152&view=rev
Log:
Add a test to make sure __has_include works from inside a macro.

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

Modified: cfe/trunk/test/Preprocessor/has_include.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/has_include.c?rev=176152&r1=176151&r2=176152&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/has_include.c (original)
+++ cfe/trunk/test/Preprocessor/has_include.c Tue Feb 26 19:34:48 2013
@@ -170,3 +170,9 @@ __has_include
 // expected-error at +1 {{expected "FILENAME" or <FILENAME>}} // expected-error at +1 {{expected value in expression}}
 #if __has_include(<stdint.h)
 #endif
+
+#define HAS_INCLUDE(header) __has_include(header)
+#if HAS_INCLUDE(<stdint.h>)
+#else
+  #error "__has_include failed (9)."
+#endif





More information about the cfe-commits mailing list