mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
These tests are marked XFAIL or UNSUPPORTED because either the tests: require libc annotation, require Mach-O support, don't recognize calls to swift-autolink-extract, requires porting alongside Linux, or rely on simd which is not present. Additionally, explicit REQUIRES for tsan/asan/fuzzer are added to some tests, since OpenBSD does not support these sanitizers or fuzzers, since it's nicer to mark that with REQUIRES rather than XFAIL.
32 lines
886 B
Swift
32 lines
886 B
Swift
// REQUIRES: tsan_runtime
|
|
// This test case used to crash when tsan ran before co-routine lowering.
|
|
// RUN: %target-swift-frontend -emit-ir -sanitize=thread %s | %FileCheck %s
|
|
|
|
// TSan is only supported on 64 bit.
|
|
// REQUIRES: PTRSIZE=64
|
|
|
|
public class C { }
|
|
|
|
public struct Foobar {
|
|
var things: [String: C] = [:]
|
|
}
|
|
|
|
extension Foobar {
|
|
public struct Index {
|
|
fileprivate typealias MyIndex = Dictionary<String, C>.Values.Index
|
|
|
|
fileprivate let myIndex: MyIndex
|
|
|
|
fileprivate init(_ index: MyIndex) {
|
|
self.myIndex = index
|
|
}
|
|
}
|
|
|
|
// We used to crash emitting the subscript function.
|
|
// CHECK: define{{( dllexport| protected)?}} swiftcc { i8*, %T15tsan_coroutines1CC* } @"$s15tsan_coroutines6FoobarVyAA1CCAC5IndexVcir"
|
|
@_borrowed
|
|
public subscript(position: Index) -> C {
|
|
return things.values[position.myIndex]
|
|
}
|
|
}
|