Files
swift-mirror/test/IRGen/temporary_allocation/negative_alignment.swift
Jonathan Grynspan f1bf7badba [SE-0322] Temporary uninitialized buffers
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.
2021-10-25 11:20:10 -04:00

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