mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This introduces a new substitution for use in the CAS tests. The plain variant of the target frontend invokes the tool with the variant target triple and resource dir only. This allows us to properly invoke the frontend for the CAS tests.
70 lines
2.6 KiB
Swift
70 lines
2.6 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O \
|
|
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
|
|
// RUN: -blocklist-file %t/blocklist.yml -blocklist-file %t/empty.yml \
|
|
// RUN: -scanner-prefix-map-paths %t /^tmp -I %t/include \
|
|
// RUN: %t/main.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas
|
|
|
|
// RUN: %{python} %S/../../utils/swift-build-modules.py --cas %t/cas %swift_frontend_plain %t/deps.json -o %t/MyApp.cmd
|
|
|
|
// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd
|
|
// RUN: %FileCheck %s -check-prefix CMD -input-file=%t/A.cmd
|
|
// CMD: -blocklist-file
|
|
// CMD-NEXT: /^tmp/blocklist.yml
|
|
// CMD-NEXT: -blocklist-file
|
|
// CMD-NEXT: /^tmp/empty.yml
|
|
|
|
// RUN: %{python} %S/Inputs/SwiftDepsExtractor.py %t/deps.json Test casFSRootID > %t/fs.casid
|
|
// DISABLE: llvm-cas --cas %t/cas --ls-tree-recursive @%t/fs.casid | %FileCheck %s -check-prefix FS
|
|
|
|
// FS-DAG: blocklist.yml
|
|
// FS-DAG: empty.yml
|
|
|
|
// RUN: %target-swift-frontend-plain \
|
|
// RUN: -target %target-future-triple \
|
|
// RUN: -emit-ir -o - -cache-compile-job -cas-path %t/cas -O \
|
|
// RUN: -swift-version 5 -module-name Test \
|
|
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
|
|
// RUN: -blocklist-file /^tmp/blocklist.yml -blocklist-file /^tmp/empty.yml \
|
|
// RUN: -enable-layout-string-value-witnesses -enable-layout-string-value-witnesses-instantiation \
|
|
// RUN: -enable-experimental-feature LayoutStringValueWitnesses -enable-experimental-feature LayoutStringValueWitnessesInstantiation \
|
|
// RUN: -cache-replay-prefix-map /^tmp %t \
|
|
// RUN: /^tmp/main.swift @%t/MyApp.cmd 2>&1 | %FileCheck %s --check-prefix CHECK-BLOCKED
|
|
|
|
// REQUIRES: swift_feature_LayoutStringValueWitnesses
|
|
// REQUIRES: swift_feature_LayoutStringValueWitnessesInstantiation
|
|
|
|
// CHECK-BLOCKED: note: Layout string value witnesses have been disabled for module 'Test' through block list entry
|
|
// CHECK-BLOCKED-NOT: type_layout_string
|
|
|
|
//--- main.swift
|
|
import A
|
|
public struct Bar {
|
|
let x: Int
|
|
let y: AnyObject
|
|
}
|
|
|
|
public enum Foo {
|
|
case a(AnyObject)
|
|
case b(Int, AnyObject)
|
|
case c
|
|
}
|
|
|
|
//--- include/A.swiftinterface
|
|
// swift-interface-format-version: 1.0
|
|
// swift-module-flags: -module-name A -O -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib -user-module-version 1.0
|
|
public func a() { }
|
|
|
|
//--- blocklist.yml
|
|
---
|
|
ShouldUseLayoutStringValueWitnesses:
|
|
ModuleName:
|
|
- Test
|
|
//--- empty.yml
|
|
---
|
|
PlaceHolder:
|
|
ModuleName:
|
|
- A
|