Files
swift-mirror/test/SILOptimizer/pound_assert_removed.swift
Marc Rasi bf18697b4f parsing, typechecking, and SILGen for #assert
`#assert` is a new static assertion statement that will let us write
tests for the new constant evaluation infrastructure that we are working
on. `#assert` works by lowering to a `Builtin.poundAssert` SIL
instruction. The constant evaluation infrastructure will look for these
SIL instructions, const-evaluate their conditions, and emit errors if
the conditions are non-constant or false.

This commit implements parsing, typechecking and SILGen for `#assert`.
2018-11-07 16:34:17 -08:00

9 lines
351 B
Swift

// RUN: %target-swift-frontend -enable-experimental-static-assert -emit-silgen %s | %target-sil-opt -irgen-prepare | %FileCheck %s
// Tests that mandatory SIL passes remove the builtin poundAssert instruction.
// CHECK-LABEL: pound_assert_removed14builtinRemoved
public func builtinRemoved() {
#assert(true)
// CHECK-NOT: builtin "poundAssert"
}