mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* Fix multi-threaded IRGen: store the DeclContext in a SILFunction explicitly instead of deriving it from the debug location. It's used in IRGen to decide into which module a function is emitted. With -gsil the debug location is changed and that should not change the module decision. * Erase debug_value/debug_value_addr instructions when using -gsil. Those instructions are not needed anymore. They can also trigger a verifier error.
18 lines
792 B
Swift
18 lines
792 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend %s -O -gsil -Xllvm -sil-print-debuginfo -emit-ir -o %t/out.ir
|
|
// RUN: %FileCheck %s < %t/out.ir
|
|
// RUN: %FileCheck %s --check-prefix=CHECK_OUT_SIL < %t/out.ir.gsil_0.sil
|
|
|
|
// Second test: check that we don't crash with multi-threaded IRGen
|
|
// RUN: %target-swift-frontend -c %s %S/Inputs/testclass.swift -wmo -O -num-threads 1 -gsil -o %t/gsil.o -o %t/testclass.o
|
|
|
|
// CHECK: !DIFile(filename: "{{.+}}gsil.swift", directory: "{{.+}}")
|
|
// CHECK: [[F:![0-9]+]] = !DIFile(filename: "{{.+}}out.ir.gsil_0.sil",
|
|
// CHECK: !DISubprogram(linkageName: "$s3out6testityyF", scope: !{{[0-9]+}}, file: [[F]], line: {{[1-9][0-9]+}},
|
|
|
|
// CHECK_OUT_SIL: sil @$s3out6testityyF : $@convention(thin) () -> () {
|
|
public func testit() {
|
|
print("Hello")
|
|
}
|
|
|