]> granicus.if.org Git - clang/commitdiff
Add a test to make sure __has_include works from inside a macro.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 27 Feb 2013 01:34:48 +0000 (01:34 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 27 Feb 2013 01:34:48 +0000 (01:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176152 91177308-0d34-0410-b5e6-96231b3b80d8

test/Preprocessor/has_include.c

index 4e71a369747581a32402c0b0dd06defcc16291e5..7cc67fac0319894c2a76c3fb3a7662cc3c87463f 100644 (file)
@@ -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