aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-27 01:34:48 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-27 01:34:48 +0000
commitb3a49f567a918406020cc2bb5a4cdba4e976d09c (patch)
tree381903e4574b79ab6cd66732427499abfef7f055
parent10b4df7ff21076c21ca764f8ca38ccaff7888f25 (diff)
Add a test to make sure __has_include works from inside a macro.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176152 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Preprocessor/has_include.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Preprocessor/has_include.c b/test/Preprocessor/has_include.c
index 4e71a36974..7cc67fac03 100644
--- a/test/Preprocessor/has_include.c
+++ b/test/Preprocessor/has_include.c
@@ -170,3 +170,9 @@ __has_include
// expected-error@+1 {{expected "FILENAME" or <FILENAME>}} // expected-error@+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