mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sorting of DeclContext-local protocols and conformances shouldn't ever be necessary, because the underlying data structures that produce these lists should be deterministic. Sorting can hide any non-determinism, so stop doing it and we can address the underlying nondeterminism.
17 lines
863 B
Swift
17 lines
863 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -swift-version 4 -emit-module -o %t/regex.swiftmodule %S/Inputs/deserialize-clang-importer-witness-tables/regex.swift
|
|
// RUN: %target-swift-frontend -swift-version 4 -emit-ir %s -I %t | %FileCheck %s
|
|
// REQUIRES: objc_interop
|
|
import regex
|
|
|
|
public func foo(line: String) {
|
|
// The NSRegularExpressionOptions: SetAlgebra conformance is used indirectly
|
|
// from the default argument expression passed to `RegEx(pattern:options:)`
|
|
// below. Ensure that a local copy of the definition was deserialized
|
|
// and lowered to IR.
|
|
// CHECK-LABEL: define {{.*}} void @"$sSo26NSRegularExpressionOptionsVs10SetAlgebraSCsACPxycfCTW"
|
|
// CHECK-LABEL: define {{.*}} i8** @"$sSo26NSRegularExpressionOptionsVABSQSCWl"()
|
|
let versionRegex = try! RegEx(pattern: "Apple")
|
|
_ = versionRegex.firstMatch(in: line)
|
|
}
|