mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Adds two new IRGen-level builtins (one for allocating, the other for deallocating), a stdlib shim function for enhanced stack-promotion heuristics, and the proposed public stdlib functions.
10 lines
351 B
Swift
10 lines
351 B
Swift
// RUN: not %target-swift-frontend -primary-file %s -O -emit-ir -o /dev/null 2>&1 | %FileCheck %s
|
|
|
|
@_silgen_name("blackHole")
|
|
func blackHole(_ value: UnsafeMutableRawPointer?) -> Void
|
|
|
|
withUnsafeTemporaryAllocation(byteCount: 1, alignment: -1) { buffer in
|
|
blackHole(buffer.baseAddress)
|
|
}
|
|
// CHECK: error: alignment value must be greater than zero
|