Files
swift-mirror/test/IRGen/temporary_allocation/non_power2_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
347 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: 3) { buffer in
blackHole(buffer.baseAddress)
}
// CHECK: error: alignment value must be a power of two