Skip to content

Commit 2acedd4

Browse files
committed
---
yaml --- r: 348135 b: refs/heads/master c: 31004b5 h: refs/heads/master i: 348133: cc9f2c0 348131: f8d070e 348127: bf2c39d
1 parent d1f671a commit 2acedd4

File tree

42 files changed

+808
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+808
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fdf1763f3d9cc7d834266028999a077fb274fa1d
2+
refs/heads/master: 31004b5fc20857a47f96e1ecb42c60cb93c13579
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/stdlib/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ else()
5151
# everything and there are various places where we link runtime code with
5252
# code built by the host compiler. Disable sanitizers for the runtime for
5353
# now.
54-
append("-fno-sanitize=all" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
54+
add_compile_options(-fno-sanitize=all)
5555
endif()
5656

5757
# Do not enforce checks for LLVM's ABI-breaking build settings.
@@ -60,7 +60,11 @@ endif()
6060
# on the presence of symbols in libSupport to identify how the code was
6161
# built and cause link failures for mismatches. Without linking that library,
6262
# we get link failures regardless, so instead, this just disables the checks.
63-
append("-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
63+
if(CMAKE_VERSION VERSION_LESS 3.12)
64+
append("-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
65+
else()
66+
add_compile_definitions(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1)
67+
endif()
6468

6569
set(SWIFT_STDLIB_LIBRARY_BUILD_TYPES)
6670
if(SWIFT_BUILD_DYNAMIC_STDLIB)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
3+
4+
garbage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -parse-stdlib
3+
4+
garbage

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/x86_64.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/System/Library/Frameworks/Zippered.framework/Modules/Zippered.swiftmodule/x86_64-apple-ios-macabi.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/System/Library/Frameworks/Zippered.framework/Modules/Zippered.swiftmodule/x86_64-apple-macos.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/System/Library/Frameworks/Zippered.framework/Modules/Zippered.swiftmodule/x86_64.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/x86_64.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/System/iOSSupport/usr/lib/swift/Foo.swiftmodule/x86_64.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/iosmac-sdk/MacOSX.sdk/usr/lib/swift/Foo.swiftmodule/x86_64.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/mock-sdk/System/Library/Frameworks/BinaryOnly_BAD.framework/Modules/BinaryOnly_BAD.swiftmodule/xyz.swiftmodule

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/mock-sdk/System/Library/Frameworks/FlatInterface_BAD.framework/Modules/FlatInterface_BAD.swiftinterface

Whitespace-only changes.

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/mock-sdk/System/Library/Frameworks/FlatModule_BAD.framework/Modules/FlatModule_BAD.swiftmodule

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
struct SomeCStruct {
2+
int value;
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Platform {
2+
header "Platform.h"
3+
export *
4+
}

trunk/test/ParseableInterface/swift_build_sdk_interfaces/Inputs/system-dependencies-sdk/usr/lib/swift/Swifty.swiftmodule/dummy-file-so-git-includes-this-otherwise-empty-directory

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
3+
4+
garbage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
3+
4+
garbage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -parse-stdlib
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule
3+
// RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule
4+
5+
// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface -emit-module -o /dev/null -module-name Normal
6+
// RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat
7+
// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface -emit-module -o /dev/null -module-name FMWK
8+
9+
// RUN: %swift_build_sdk_interfaces -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -v -o %t/prebuilt -check-only
10+
// RUN: ls %t/prebuilt | %FileCheck %s
11+
// CHECK-DAG: Normal.swiftmodule
12+
// CHECK-DAG: Flat.swiftmodule
13+
// CHECK-DAG: FMWK.swiftmodule
14+
15+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
16+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
17+
18+
// Touch a file in the SDK (to make it look like it changed) and try again.
19+
// In -check-only mode, this should force a rebuild.
20+
// RUN: rm -rf %t/MCP
21+
// RUN: %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface
22+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
23+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule
24+
25+
import Normal
26+
import Flat
27+
import FMWK
28+
29+
func test() {
30+
normal()
31+
flat()
32+
fmwk()
33+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -o %t/output -debug-crash-compiler 2>&1 | %FileCheck %s
2+
3+
CHECK: Program arguments:
4+
CHECK-SAME: -debug-crash-immediately
5+
CHECK-SAME: {{.+}}.swiftinterface
6+
7+
REQUIRES: asserts
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule
3+
// RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule
4+
5+
// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface -emit-module -o /dev/null -module-name Normal
6+
// RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat
7+
// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface -emit-module -o /dev/null -module-name FMWK
8+
9+
// RUN: %swift_build_sdk_interfaces -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -v -o %t/prebuilt
10+
// RUN: ls %t/prebuilt | %FileCheck %s
11+
// CHECK-DAG: Normal.swiftmodule
12+
// CHECK-DAG: Flat.swiftmodule
13+
// CHECK-DAG: FMWK.swiftmodule
14+
15+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
16+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
17+
18+
// Touch a file in the SDK (to make it look like it changed) and try again.
19+
// This should still be able to use the prebuilt modules because they track
20+
// content hashes, not just size+mtime.
21+
// RUN: rm -rf %t/MCP
22+
// RUN: %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface
23+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
24+
// RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s
25+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
26+
27+
// CHECK-CACHE-DAG: Normal-{{.+}}.swiftmodule
28+
// CHECK-CACHE-DAG: Flat-{{.+}}.swiftmodule
29+
// CHECK-CACHE-DAG: FMWK-{{.+}}.swiftmodule
30+
31+
// Actually change a file in the SDK, to check that we're tracking dependencies
32+
// at all.
33+
// RUN: rm -rf %t/MCP
34+
// RUN: echo "public func another()" >> %t/sdk/usr/lib/swift/Normal.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface
35+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
36+
// RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s
37+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule
38+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule
39+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/FMWK-*.swiftmodule
40+
41+
// Without the prebuilt cache everything should still work; it'll just take time
42+
// because we have to build the interfaces.
43+
// RUN: rm -rf %t/MCP
44+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP
45+
// RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s
46+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule
47+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule
48+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/FMWK-*.swiftmodule
49+
50+
51+
import Normal
52+
import Flat
53+
import FMWK
54+
55+
func test() {
56+
normal()
57+
flat()
58+
fmwk()
59+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
RUN: not %swift_build_sdk_interfaces 2>&1 | %FileCheck -check-prefix NO-OUTPUT %s
2+
NO-OUTPUT: argument -o is required
3+
4+
RUN: not env -u SDKROOT %swift_build_sdk_interfaces -o %t 2>&1 | %FileCheck -check-prefix NO-SDK %s
5+
NO-SDK: SDKROOT must be set
6+
7+
RUN: not %swift_build_sdk_interfaces -o %t -sdk %S/nonexistent 2>&1 | %FileCheck -check-prefix BAD-SDK %s
8+
BAD-SDK: invalid SDK: {{.+[/\\]nonexistent$}}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -v -n -o %t/output > %t.txt
2+
RUN: %FileCheck %s < %t.txt
3+
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
4+
5+
CHECK-DAG: System/Library/Frameworks/Simple.framework/Modules/Simple.swiftmodule/xyz.swiftinterface -o {{.+}}output/Simple.swiftmodule/xyz.swiftmodule
6+
CHECK-DAG: usr/lib/swift/Flat.swiftinterface -o {{.+}}output/Flat.swiftmodule
7+
CHECK-DAG: usr/lib/swift/Normal.swiftmodule/xyz.swiftinterface -o {{.+}}output/Normal.swiftmodule/xyz.swiftmodule
8+
CHECK-DAG: System/iOSSupport/System/Library/Frameworks/Simple.framework/Modules/Simple.swiftmodule/xyzzy.swiftinterface -o {{.+}}output/Simple.swiftmodule/xyzzy.swiftmodule
9+
CHECK-DAG: System/iOSSupport/usr/lib/swift/Caramel.swiftmodule/xyz.swiftinterface -o {{.+}}output/Caramel.swiftmodule/xyz.swiftmodule
10+
11+
NEGATIVE-NOT: BAD
12+
13+
RUN: env SDKROOT=%S/Inputs/mock-sdk/ %swift_build_sdk_interfaces -v -n -o %t/output > %t.txt
14+
RUN: %FileCheck %s < %t.txt
15+
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
16+
17+
# Make sure the stdlib is processed first.
18+
RUN: %empty-directory(%t)
19+
RUN: cp -r %S/Inputs/mock-sdk %t/sdk
20+
RUN: mkdir %t/sdk/usr/lib/swift/Swift.swiftmodule
21+
RUN: touch %t/sdk/usr/lib/swift/Swift.swiftmodule/abc.swiftinterface
22+
RUN: touch %t/sdk/usr/lib/swift/Swift.swiftmodule/def.swiftinterface
23+
RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -n -o %t/output | %FileCheck -check-prefix CHECK-WITH-STDLIB %s
24+
25+
CHECK-WITH-STDLIB-NOT: .swiftinterface -o
26+
CHECK-WITH-STDLIB: Swift.swiftmodule/{{abc|def}}.swiftinterface -o
27+
CHECK-WITH-STDLIB-NOT: .swiftinterface -o
28+
CHECK-WITH-STDLIB: Swift.swiftmodule/{{abc|def}}.swiftinterface -o
29+
CHECK-WITH-STDLIB: .swiftinterface -o
30+
31+
# ...unless we pass -skip-stdlib.
32+
RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -n -o %t/output -skip-stdlib > %t.txt
33+
RUN: %FileCheck -check-prefix CHECK-SKIP-STDLIB %s < %t.txt
34+
RUN: %FileCheck -check-prefix NEGATIVE-SKIP-STDLIB %s < %t.txt
35+
36+
CHECK-SKIP-STDLIB: .swiftinterface -o
37+
NEGATIVE-SKIP-STDLIB-NOT: Swift.swiftmodule
38+
39+
# Check custom searching based on positional arguments.
40+
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -v -n -o %t/output System/Library/PrivateFrameworks > %t.txt
41+
RUN: %FileCheck -check-prefix CHECK-CUSTOM-PATHS %s < %t.txt
42+
RUN: %FileCheck -check-prefix NEGATIVE-CUSTOM-PATHS %s < %t.txt
43+
44+
CHECK-CUSTOM-PATHS-DAG: System/Library/PrivateFrameworks/PrivateSimple.framework/Modules/PrivateSimple.swiftmodule/xyz.swiftinterface -o {{.+}}output/PrivateSimple.swiftmodule/xyz.swiftmodule
45+
CHECK-CUSTOM-PATHS-DAG: usr/lib/swift/Flat.swiftinterface -o {{.+}}output/Flat.swiftmodule
46+
CHECK-CUSTOM-PATHS-DAG: usr/lib/swift/Normal.swiftmodule/xyz.swiftinterface -o {{.+}}output/Normal.swiftmodule/xyz.swiftmodule
47+
CHECK-CUSTOM-PATHS-DAG: System/iOSSupport/usr/lib/swift/Caramel.swiftmodule/xyz.swiftinterface -o {{.+}}output/Caramel.swiftmodule/xyz.swiftmodule
48+
NEGATIVE-CUSTOM-PATHS-NOT: System/Library/Frameworks/
49+
50+
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -v -n -o %t/output System/Library/Frameworks System/Library/PrivateFrameworks > %t.txt
51+
RUN: %FileCheck -check-prefix CHECK-CUSTOM-PATHS -check-prefix CHECK-NORMAL-PATHS %s < %t.txt
52+
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
53+
54+
CHECK-NORMAL-PATHS-DAG: System/Library/Frameworks/Simple.framework/Modules/Simple.swiftmodule/xyz.swiftinterface -o {{.+}}output/Simple.swiftmodule/xyz.swiftmodule
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output | %FileCheck %s
2+
3+
CHECK-DAG: # (FAIL) {{.+}}/Bad.swiftinterface
4+
CHECK-DAG: # (PASS) {{.+}}/Good.swiftinterface
5+
6+
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -ignore-non-stdlib-failures | %FileCheck -check-prefix=CHECK-IGNORING-FAILURES %s
7+
8+
CHECK-IGNORING-FAILURES-DAG: # (XFAIL) {{.+}}/Bad.swiftinterface
9+
CHECK-IGNORING-FAILURES-DAG: # (UPASS) {{.+}}/Good.swiftinterface
10+
11+
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output | %FileCheck -check-prefix CHECK-BROKEN-STDLIB %s
12+
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output -ignore-non-stdlib-failures | %FileCheck -check-prefix CHECK-BROKEN-STDLIB %s
13+
14+
CHECK-BROKEN-STDLIB: # (FAIL) {{.+}}/Swift.swiftinterface
15+
CHECK-BROKEN-STDLIB-NOT: {{^}}#
16+
17+
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output -skip-stdlib | %FileCheck %s
18+
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output -skip-stdlib -ignore-non-stdlib-failures | %FileCheck -check-prefix=CHECK-IGNORING-FAILURES %s
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/iosmac-sdk/MacOSX.sdk/ -Fsystem-iosmac SECRET_SEARCH_PATH -v -n -o %t/output > %t.txt
2+
RUN: %FileCheck %s < %t.txt
3+
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
4+
5+
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/x86_64.swiftinterface -o {{.+}}/output/FMWK.swiftmodule/x86_64-apple-macos.swiftmodule
6+
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/x86_64.swiftinterface -o {{.+}}/output/FMWK.swiftmodule/x86_64-apple-ios-macabi.swiftmodule
7+
CHECK-DAG: MacOSX.sdk/usr/lib/swift/Foo.swiftmodule/x86_64.swiftinterface -o {{.+}}output/Foo.swiftmodule/x86_64-apple-macos.swiftmodule
8+
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/usr/lib/swift/Foo.swiftmodule/x86_64.swiftinterface -o {{.+}}output/Foo.swiftmodule/x86_64-apple-ios-macabi.swiftmodule
9+
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks/Zippered.framework/Modules/Zippered.swiftmodule/x86_64.swiftinterface -o {{.+}}/output/Zippered.swiftmodule/x86_64-apple-macos.swiftmodule
10+
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks/Zippered.framework/Modules/Zippered.swiftmodule/x86_64-apple-macos.swiftinterface -o {{.+}}/output/Zippered.swiftmodule/x86_64-apple-macos.swiftmodule
11+
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks {{.+}}MacOSX.sdk/System/Library/Frameworks/Zippered.framework/Modules/Zippered.swiftmodule/x86_64-apple-ios-macabi.swiftinterface -o {{.+}}/output/Zippered.swiftmodule/x86_64-apple-ios-macabi.swiftmodule
12+
13+
NEGATIVE-NOT: iOSSupport{{.+}}{{macos|x86_64}}.swiftmodule
14+
NEGATIVE-NOT: SECRET_SEARCH_PATH{{.+}}{{macos|x86_64}}.swiftmodule
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Make a local copy of the substitutions.
2+
config.substitutions = list(config.substitutions)
3+
4+
swift_build_sdk_interfaces = (r'env SWIFT_EXEC=%%swiftc_driver_plain %r '
5+
r'%%utils/swift_build_sdk_interfaces.py '
6+
r'%%mcp_opt' %
7+
(sys.executable,))
8+
config.substitutions.insert(0, ('%swift_build_sdk_interfaces',
9+
swift_build_sdk_interfaces))
10+
11+
config.suffixes.add('.py')
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# RUN: %swift_build_sdk_interfaces -machine-parseable-monotonic-version | \
2+
# RUN: %{python} %s
3+
4+
import sys
5+
6+
lines = list(sys.stdin)
7+
assert len(lines) == 1
8+
assert int(lines[0]) > 0
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: cp -r %S/Inputs/system-dependencies-sdk %t/sdk
3+
// RUN: echo 'import Platform; public func usesCStruct(_: SomeCStruct?) {}' | %target-swift-frontend - -emit-parseable-module-interface-path %t/sdk/usr/lib/swift/Swifty.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface -emit-module -o /dev/null -module-name Swifty -sdk %t/sdk
4+
5+
// RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -o %t/prebuilt
6+
// RUN: ls %t/prebuilt | %FileCheck %s
7+
// CHECK: Swifty.swiftmodule
8+
9+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
10+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
11+
12+
// Touch a file in the SDK (to make it look like it changed) and try again.
13+
// This should still be able to use the prebuilt modules because they track
14+
// content hashes, not just size+mtime.
15+
// RUN: rm -rf %t/MCP
16+
// RUN: %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/include/Platform.h
17+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
18+
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule
19+
20+
// Actually change a file in the SDK, to check that we're tracking dependencies
21+
// at all.
22+
// RUN: rm -rf %t/MCP
23+
// RUN: echo "void unrelated();" >> %t/sdk/usr/include/Platform.h
24+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
25+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule
26+
27+
// Without the prebuilt cache everything should still work; it'll just take time
28+
// because we have to build the interfaces.
29+
// RUN: rm -rf %t/MCP
30+
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP
31+
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule
32+
33+
import Swifty
34+
35+
usesCStruct(nil)

0 commit comments

Comments
 (0)