Files
swift-mirror/test/IRGen/deserialize-clang-importer-witness-tables.swift
Doug Gregor d31ef61a28 Eliminate "sorting" of DeclContext-local protocols / conformances.
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.
2019-02-15 14:16:48 -08:00

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)
}