|
| 1 | +// REQUIRES: OS=macosx |
| 2 | + |
| 3 | +// RUN: %empty-directory(%t) |
| 4 | +// RUN: split-file %s %t |
| 5 | + |
| 6 | +// RUN: %target-swift-frontend -scan-dependencies -target arm64-apple-macos11 -module-name Test -module-cache-path %t/clang-module-cache -O \ |
| 7 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \ |
| 8 | +// RUN: %t/test.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas \ |
| 9 | +// RUN: -I %t/include -clang-target arm64-apple-macos13 |
| 10 | + |
| 11 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:A > %t/a.cmd |
| 12 | +// RUN: %swift_frontend_plain @%t/a.cmd |
| 13 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Foo > %t/foo.cmd |
| 14 | +// RUN: %swift_frontend_plain @%t/foo.cmd |
| 15 | + |
| 16 | +// RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json |
| 17 | +// RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid |
| 18 | + |
| 19 | +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd |
| 20 | + |
| 21 | +// RUN: %target-swift-frontend -c -o %t/test.o -target arm64-apple-macos11 \ |
| 22 | +// RUN: -clang-target arm64-apple-macos13 -cache-compile-job -cas-path %t/cas \ |
| 23 | +// RUN: -disable-implicit-swift-modules -swift-version 5 -parse-stdlib -O \ |
| 24 | +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ |
| 25 | +// RUN: -module-name Test -explicit-swift-module-map-file @%t/map.casid \ |
| 26 | +// RUN: %t/test.swift @%t/MyApp.cmd |
| 27 | + |
| 28 | +// RUN: llvm-objdump --macho --all-headers %t/test.o | %FileCheck %s |
| 29 | + |
| 30 | +// CHECK: cmd LC_BUILD_VERSION |
| 31 | +// CHECK-NEXT: cmdsize |
| 32 | +// CHECK-NEXT: platform macos |
| 33 | +// CHECK-NEXT: sdk |
| 34 | +// CHECK-NEXT: minos 11.0 |
| 35 | + |
| 36 | +//--- include/module.modulemap |
| 37 | +module A { |
| 38 | + header "a.h" |
| 39 | + export * |
| 40 | +} |
| 41 | +//--- include/a.h |
| 42 | +void a(void); |
| 43 | + |
| 44 | +//--- include/Foo.swiftinterface |
| 45 | +// swift-interface-format-version: 1.0 |
| 46 | +// swift-module-flags: -target arm64-apple-macos13 -enable-library-evolution -swift-version 5 -O -module-name Foo -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib |
| 47 | +import A |
| 48 | +public func foo() |
| 49 | + |
| 50 | +//--- test.swift |
| 51 | +import Foo |
0 commit comments