blob: 79e50de86b9da5e23cff5cc8b7823e65a9ca77e8 [file] [log] [blame]
// SWIFT_ENABLE_TENSORFLOW
// UNSUPPORTED: tensorflow
// RUN: %target-typecheck-verify-swift -swift-version 5 -solver-expression-time-threshold=1
// rdar://problem/32998180
func checksum(value: UInt16) -> UInt16 {
var checksum = (((value >> 2) ^ (value >> 8) ^ (value >> 12) ^ (value >> 14)) & 0x01) << 1
// expected-error@-1 {{the compiler is unable to type-check this expression in reasonable time}}
checksum |= (((value) ^ (value >> UInt16(4)) ^ (value >> UInt16(6)) ^ (value >> UInt16(10))) & 0x01)
// expected-error@-1 {{the compiler is unable to type-check this expression in reasonable time}}
checksum ^= 0x02
return checksum
}
// rdar://problem/42672829
func f(tail: UInt64, byteCount: UInt64) {
if tail & ~(1 << ((byteCount & 7) << 3) - 1) == 0 { }
}
// rdar://problem/32547805
func size(count: Int) {
// Size of the buffer we need to allocate
let _ = count * MemoryLayout<Float>.size * (4 + 3 + 3 + 2 + 4)
// expected-error@-1 {{the compiler is unable to type-check this expression in reasonable time}}
}