File tree 4 files changed +41
-2
lines changed
4 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -518,8 +518,6 @@ ClangImporter::create(ASTContext &ctx,
518
518
519
519
clang::Preprocessor &clangPP = instance.getPreprocessor ();
520
520
clangPP.enableIncrementalProcessing ();
521
- auto *CB = new HeaderImportCallbacks (*importer, importer->Impl );
522
- clangPP.addPPCallbacks (std::unique_ptr<clang::PPCallbacks>(CB));
523
521
524
522
instance.createModuleManager ();
525
523
instance.getModuleManager ()->addListener (
@@ -537,6 +535,9 @@ ClangImporter::create(ASTContext &ctx,
537
535
clang::Parser::DeclGroupPtrTy parsed;
538
536
while (!importer->Impl .Parser ->ParseTopLevelDecl (parsed)) {}
539
537
538
+ auto *CB = new HeaderImportCallbacks (*importer, importer->Impl );
539
+ clangPP.addPPCallbacks (std::unique_ptr<clang::PPCallbacks>(CB));
540
+
540
541
// Create the selectors we'll be looking for.
541
542
auto &clangContext = importer->Impl .Instance ->getASTContext ();
542
543
importer->Impl .objectAtIndexedSubscript
Original file line number Diff line number Diff line change
1
+ @import Security ;
2
+
3
+ extern const int includedConst ;
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -Xcc -include -Xcc %S/Inputs/Xcc_include.h -parse %s 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE-ONLY %s
2
+
3
+ // RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -Xcc -include -Xcc %S/Inputs/Xcc_include.h -import-objc-header %S/../../Inputs/empty.swift -parse %s 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE-PLUS-BRIDGING %s
4
+
5
+ // RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -Xcc -include -Xcc %S/Inputs/Xcc_include.h -F %S/Inputs/mixed-target/ -module-name Mixed -import-underlying-module -parse %s -disable-objc-attr-requires-foundation-module 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE-FRAMEWORK %s
6
+
7
+ // RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -Xcc -include -Xcc %S/Inputs/this_header_does_not_exist.h -parse %s 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE-MISSING %s
8
+
9
+ // CHECK-INCLUDE-MISSING: error: '{{.*}}this_header_does_not_exist.h' file not found
10
+
11
+ func test( ) {
12
+ // CHECK-INCLUDE-ONLY: error: use of unresolved identifier 'includedConst'
13
+ // CHECK-INCLUDE-PLUS-BRIDGING-NOT: unresolved identifier 'includedConst'
14
+ // CHECK-INCLUDE-FRAMEWORK: error: use of unresolved identifier 'includedConst'
15
+ _ = includedConst
16
+
17
+ // CHECK-INCLUDE-ONLY: error: use of unresolved identifier 'errSecSuccess'
18
+ // CHECK-INCLUDE-PLUS-BRIDGING: error: use of unresolved identifier 'errSecSuccess'
19
+ // CHECK-INCLUDE-FRAMEWORK: error: use of unresolved identifier 'errSecSuccess'
20
+ _ = errSecSuccess
21
+
22
+ #if FRAMEWORK
23
+ // CHECK-INCLUDE-FRAMEWORK-NOT: error: unresolved identifier 'Base'
24
+ _ = Base ( )
25
+ #endif
26
+ }
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-frontend -parse -verify %s -import-objc-header %S/Inputs/sdk-bridging-header.h
2
2
// RUN: not %target-swift-frontend -parse %s -import-objc-header %S/Inputs/bad-bridging-header.h 2>&1 | FileCheck -check-prefix=CHECK-FATAL %s
3
3
4
+ // RUN: %target-swift-frontend -parse -verify %s -Xcc -include -Xcc %S/Inputs/sdk-bridging-header.h -import-objc-header %S/../Inputs/empty.swift
5
+
6
+ // RUN: not %target-swift-frontend -parse %s -Xcc -include -Xcc %S/Inputs/bad-bridging-header.h 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE %s
7
+ // RUN: not %target-swift-frontend -parse %s -Xcc -include -Xcc %S/Inputs/bad-bridging-header.h -import-objc-header %S/../Inputs/empty.swift 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE %s
8
+ // RUN: not %target-swift-frontend -parse %s -Xcc -include -Xcc %S/Inputs/bad-bridging-header.h -import-objc-header %S/Inputs/sdk-bridging-header.h 2>&1 | FileCheck -check-prefix=CHECK-INCLUDE %s
9
+
4
10
// CHECK-FATAL: failed to import bridging header
5
11
12
+ // CHECK-INCLUDE: error: 'this-header-does-not-exist.h' file not found
13
+ // CHECK-INCLUDE: error: use of unresolved identifier 'Predicate'
14
+
6
15
// REQUIRES: objc_interop
7
16
8
17
import Foundation
You can’t perform that action at this time.
0 commit comments