mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The Swift driver is passing the optimization record file path via the supplementals output, instead of the flag, on certain circumstances. Enhance the frontend to check supplemental outputs otherwise the record file will not get emitted when using the new swift driver.
28 lines
996 B
Swift
28 lines
996 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: echo '"%s": { yaml-opt-record: "%t/foo.opt.yaml" }' > %t/filemap.yaml.yaml
|
|
// RUN: echo '"%s": { bitstream-opt-record: "%t/foo.opt.bitstream" }' > %t/filemap.bitstream.yaml
|
|
|
|
// RUN: %target-swift-frontend -c -O -wmo -save-optimization-record=bitstream %s -module-name foo -o %t/foo.o -supplementary-output-file-map %t/filemap.bitstream.yaml
|
|
// RUN: llvm-bcanalyzer -dump "%t/foo.opt.bitstream" | %FileCheck -check-prefix=BITSTREAM %s
|
|
|
|
// RUN: %target-swift-frontend -c -O -wmo -save-optimization-record=yaml %s -module-name foo -o %t/foo.o -supplementary-output-file-map %t/filemap.yaml.yaml
|
|
// RUN: %FileCheck %s -check-prefix=YAML --input-file=%t/foo.opt.yaml
|
|
|
|
// REQUIRES: VENDOR=apple
|
|
|
|
var a: Int = 1
|
|
|
|
#sourceLocation(file: "custom.swift", line: 2000)
|
|
func foo() {
|
|
a = 2
|
|
}
|
|
#sourceLocation() // reset
|
|
|
|
public func bar() {
|
|
foo()
|
|
// BITSTREAM: <Remark NumWords=13 BlockCodeSize=4>
|
|
// BITSTREAM: </Remark>
|
|
|
|
// YAML: sil-assembly-vision-remark-gen
|
|
}
|