Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21280 from DougGregor/simd-operator-type-check-pe…
…rf-hack-5.0 [5.0] [Constraint solver] De-prioritize SIMD operators.
- Loading branch information
Showing
4 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
validation-test/Sema/type_checker_perf/fast/rdar46541800.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// RUN: %target-typecheck-verify-swift | ||
// REQUIRES: OS=macosx | ||
|
||
import simd | ||
import CoreGraphics | ||
import Foundation | ||
|
||
class SomeView { | ||
func layoutSubviews() { | ||
let descriptionTextViewFrame = CGRect.zero | ||
let availableBounds = CGRect() | ||
let descriptionLabelProperties = SomeView.descriptionTextViewLabelProperties() | ||
let textSize = descriptionTextView.sizeThatFits(availableBounds.size) | ||
let textInset = descriptionTextView.textInset(forBounds: CGRect(origin: .zero, size: textSize)) | ||
let descriptionTextBaselineOffset: CGFloat = CGFloat() | ||
let displayScale: CGFloat = CGFloat() | ||
let _ = (descriptionTextViewFrame.height | ||
+ (-descriptionTextView.lastBaselineOffsetFromBottom - textInset.bottom + descriptionLabelProperties.lastBaselineOffsetFromBottom) | ||
+ (-descriptionTextView.firstBaselineOffsetFromTop - textInset.top + descriptionTextBaselineOffset).ceilingValue(scale: displayScale) | ||
) | ||
} | ||
|
||
static func descriptionTextViewLabelProperties() -> FontDescriptorBaselineProperties { | ||
fatalError() | ||
} | ||
|
||
lazy var descriptionTextView: SomeOtherView = SomeOtherView() | ||
} | ||
|
||
class SomeOtherView { | ||
init() { } | ||
func sizeThatFits(_ size: CGSize) -> CGSize { return size } | ||
} | ||
|
||
|
||
struct FontDescriptorBaselineProperties { | ||
// let fontDescriptor: MPUFontDescriptor | ||
let defaultFirstBaselineOffsetFromTop: CGFloat | ||
let defaultLastBaselineOffsetFromBottom: CGFloat | ||
var firstBaselineOffsetFromTop: CGFloat { fatalError() } | ||
var lastBaselineOffsetFromBottom: CGFloat { | ||
fatalError() | ||
} | ||
} | ||
|
||
struct EdgeInsets { | ||
var top: CGFloat | ||
var bottom: CGFloat | ||
} | ||
|
||
extension SomeOtherView { | ||
func textInset(forBounds bounds: CGRect) -> EdgeInsets { fatalError() } | ||
var firstBaselineOffsetFromTop: CGFloat { fatalError() } | ||
var lastBaselineOffsetFromBottom: CGFloat { | ||
fatalError() | ||
} | ||
} | ||
|
||
extension CGFloat { | ||
public func ceilingValue(scale: CGFloat) -> CGFloat { fatalError() } | ||
} |