|
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)
|
|
45 | 48 | // We also check that ClangImporter noticed SwiftShims in the toolchain and
|
46 | 49 | // didn't add a -isystem flag to look in the SDK.
|
47 | 50 |
|
48 |
| -// FIXME: We can't properly test this on a non-Darwin platform because we'll get |
49 |
| -// the same error message for "unloadable standard library" and "no standard |
50 |
| -// library" (https://github.com/apple/swift/issues/52499). |
51 |
| -// REQUIRES: objc_interop |
52 |
| - |
53 | 51 | // RUN: %empty-directory(%t/mcp)
|
54 | 52 | // 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
|
55 |
| -// CHECK-EMPTY-NOT: '-isystem' '{{.*}}/bad-sdk/usr/lib/swift/shims' |
56 |
| -// CHECK-EMPTY: error: could not find module 'Swift' for target '{{.*}}'; found: garbage-garbage-garbage, at: {{.*}}/Swift.swiftmodule |
| 53 | +// CHECK-EMPTY-NOT: '-isystem' '{{.*(\\|/)}}bad-sdk{{\\|/}}usr{{\\|/}}lib{{\\|/}}swift{{\\|/}}shims' |
| 54 | +// CHECK-EMPTY: error: could not find module 'Swift' for target '{{.*}}'; found: garbage-garbage-garbage, at: {{.*(\\|/)}}Swift.swiftmodule |
57 | 55 |
|
58 | 56 | // Check that, when the toolchain *doesn't* have SwiftShims in it, ClagImporter
|
59 | 57 | // *does* add a -I flag to look in the SDK.
|
60 | 58 |
|
61 | 59 | // RUN: %empty-directory(%t/mcp)
|
62 | 60 | // RUN: not %target-swift-frontend(mock-sdk: -sdk %t/bad-sdk) -resource-dir %t/really-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-REALLY-EMPTY %s
|
63 |
| -// CHECK-REALLY-EMPTY: '-isystem' '{{.*}}/bad-sdk/usr/lib/swift/shims' |
64 |
| -// CHECK-REALLY-EMPTY: error: could not find module 'Swift' for target '{{.*}}'; found: garbage-garbage-garbage, at: {{.*}}/Swift.swiftmodule |
| 61 | +// CHECK-REALLY-EMPTY: '-isystem' '{{.*(\\|/)}}bad-sdk{{\\|/}}usr{{\\|/}}lib{{\\|/}}swift{{\\|/}}shims' |
| 62 | +// CHECK-REALLY-EMPTY: error: could not find module 'Swift' for target '{{.*}}'; found: garbage-garbage-garbage, at: {{.*(\\|/)}}Swift.swiftmodule |
65 | 63 |
|
66 | 64 | let x: Int = 1
|
0 commit comments