|
6 | 6 |
|
7 | 7 | // %t/good-sdk contains a loadable standard library.
|
8 | 8 | // RUN: %empty-directory(%t/good-sdk)
|
9 |
| -// RUN: %empty-directory(%t/good-sdk/usr/lib/swift) |
| 9 | +// RUN: %empty-directory(%t/good-sdk/usr/lib/swift/%target-sdk-name) |
10 | 10 | // RUN: cp -r %platform-module-dir/Swift.swiftmodule %t/good-sdk/usr/lib/swift/Swift.swiftmodule
|
| 11 | +// RUN: cp -r %platform-module-dir/Swift.swiftmodule %t/good-sdk/usr/lib/swift/%target-sdk-name/Swift.swiftmodule |
11 | 12 |
|
12 | 13 | // %t/bad-sdk contains an invalid standard library that cannot be loaded.
|
13 | 14 | // RUN: %empty-directory(%t/bad-sdk)
|
14 | 15 | // RUN: %empty-directory(%t/bad-sdk/usr/lib/swift/Swift.swiftmodule)
|
| 16 | +// RUN: %empty-directory(%t/bad-sdk/usr/lib/swift/%target-sdk-name/Swift.swiftmodule) |
15 | 17 | // RUN: touch %t/bad-sdk/usr/lib/swift/Swift.swiftmodule/garbage-garbage-garbage.swiftmodule
|
| 18 | +// RUN: touch %t/bad-sdk/usr/lib/swift/%target-sdk-name/Swift.swiftmodule/garbage-garbage-garbage.swiftmodule |
16 | 19 |
|
17 | 20 | // %t/empty-toolchain does not contain a standard library.
|
18 | 21 | // RUN: %empty-directory(%t/empty-toolchain)
|
|
38 | 41 | // RUN: %empty-directory(%t/mcp)
|
39 | 42 | // RUN: %target-swift-frontend(mock-sdk: -sdk %t/bad-sdk) -module-cache-path %t/mcp -typecheck -verify -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import %s
|
40 | 43 |
|
| 44 | +// What happens if we specify an explicit resource-dir with a corrupt runtime |
| 45 | +// swiftmodule: is it actually used? |
| 46 | + |
| 47 | +// RUN: %empty-directory(%t/mcp) |
| 48 | +// RUN: %target-swift-frontend(mock-sdk: -sdk %t/good-sdk) -Xcc -v -resource-dir %t/bad-sdk/usr/lib/swift -module-cache-path %t/mcp -typecheck -verify -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import %s |
| 49 | + |
41 | 50 | // If neither the resource directory nor the SDK contains a runtime swiftmodule,
|
42 | 51 | // loading should fail. This just proves that we aren't getting runtime imports
|
43 | 52 | // some other way.
|
|
48 | 57 | // FIXME: We can't properly test this on a non-Darwin platform because we'll get
|
49 | 58 | // the same error message for "unloadable standard library" and "no standard
|
50 | 59 | // library" (https://github.com/apple/swift/issues/52499).
|
51 |
| -// REQUIRES: objc_interop |
52 | 60 |
|
53 | 61 | // RUN: %empty-directory(%t/mcp)
|
54 | 62 | // RUN: not %target-swift-frontend(mock-sdk: -sdk %t/bad-sdk) -resource-dir %t/empty-toolchain/usr/lib/swift -module-cache-path %t/mcp -typecheck %s -dump-clang-diagnostics -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import 2>&1 | %FileCheck --check-prefix CHECK-EMPTY %s
|
|
0 commit comments