Add __has_feature(objc_modules)

llvm-svn: 147482
This commit is contained in:
Douglas Gregor 2012-01-03 21:12:26 +00:00
parent 493c1b3152
commit 173d499c25
2 changed files with 12 additions and 0 deletions

View File

@ -617,6 +617,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
LangOpts.ObjCRuntimeHasWeak)
.Case("objc_fixed_enum", LangOpts.ObjC2)
.Case("objc_instancetype", LangOpts.ObjC2)
.Case("objc_modules", LangOpts.Modules)
.Case("objc_nonfragile_abi", LangOpts.ObjCNonFragileABI)
.Case("objc_weak_class", LangOpts.ObjCNonFragileABI)
.Case("ownership_holds", true)

View File

@ -0,0 +1,11 @@
// RUN: %clang_cc1 -E -fmodules %s -o - | FileCheck --check-prefix=CHECK-HAS-MODULES %s
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-MODULES %s
#if __has_feature(objc_modules)
int has_modules();
#else
int no_modules();
#endif
// CHECK-HAS-MODULES: has_modules
// CHECK-NO-MODULES: no_modules