Skip to content

Commit c41dd21

Browse files
committed
[test] Ensure clang importer sdk uses its own CoreFoundation overlay
We noticed that Some tests using the clang importer sdk ended up using the CoreFoundation overlay built as part of Swift instead of the mock one provided.
1 parent 1d4009a commit c41dd21

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

test/IDE/print_clang_header_i386.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
// XFAIL: linux, freebsd
55

66
// RUN: echo '#include "header-to-print.h"' > %t.i386.m
7-
// RUN: %target-swift-ide-test -source-filename %s -print-header -header-to-print %S/Inputs/print_clang_header/header-to-print.h -print-regular-comments --cc-args -arch i386 -isysroot %clang-importer-sdk-path -fsyntax-only %t.i386.m -I %S/Inputs/print_clang_header > %t.i386.txt
7+
// RUN: %empty-directory(%t)
8+
// RUN: %build-clang-importer-objc-overlays
9+
// RUN: %target-swift-ide-test -source-filename %s -print-header -header-to-print %S/Inputs/print_clang_header/header-to-print.h -print-regular-comments -I %t --cc-args -arch i386 -isysroot %clang-importer-sdk-path -fsyntax-only %t.i386.m -I %S/Inputs/print_clang_header > %t.i386.txt
810
// RUN: diff -u %S/Inputs/print_clang_header/header-to-print.h.printed.txt %t.i386.txt
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@_exported import CoreFoundation
22

3-
protocol _CFObject {}
3+
protocol _CFObject: Hashable {}

test/lit.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ config.substitutions.append( ('%clang-include-dir', config.clang_include_dir) )
459459
config.substitutions.append(('%build-clang-importer-objc-overlays',
460460
'%target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -enable-objc-interop -emit-module -o %t %clang-importer-sdk-path/swift-modules/ObjectiveC.swift -disable-objc-attr-requires-foundation-module && '
461461
'%target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -enable-objc-interop -emit-module -o %t %clang-importer-sdk-path/swift-modules/CoreGraphics.swift && '
462+
'%target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -enable-objc-interop -emit-module -o %t %clang-importer-sdk-path/swift-modules/CoreFoundation.swift && '
462463
'%target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -enable-objc-interop -emit-module -o %t %clang-importer-sdk-path/swift-modules/Foundation.swift'))
463464

464465
# FIXME: BEGIN -enable-source-import hackaround

0 commit comments

Comments
 (0)