Files
swift-mirror/test/embedded/debug-precondition-condfail.swift
Erik Eckstein 3243f87204 tests: remove the lit feature swift_in_compiler
Tests require the compiler built with SwiftCompilerSources since a long time.
So this lit feature was redundant anyway. We can remove it.
2026-06-30 14:47:56 +02:00

20 lines
796 B
Swift

// RUN: %target-swift-frontend -g -emit-sil %s -enable-experimental-feature Embedded -module-name trap -wmo -o - | %FileCheck %s
// RUN: %target-swift-frontend -g -emit-ir %s -enable-experimental-feature Embedded -module-name trap -wmo -o - | %FileCheck -check-prefix IR %s
// REQUIRES: swift_feature_Embedded
// REQUIRES: CPU=x86_64 || CPU=arm64 || CPU=arm64e
// CHECK-LABEL: sil @$e4trap11rebindCheck3ptr8capacityySpySuG_SitFySpys5Int64VGXEfU_
public func rebindCheck(ptr: UnsafeMutablePointer<UInt>, capacity: Int) {
// CHECK-NOT: _assertionFa
// CHECK: cond_fail
// CHECK-NOT: _assertionFa
// CHECK: return
ptr.withMemoryRebound(to: Int64.self, capacity: capacity) {
$0.pointee.negate()
}
}
// IR: distinct !DISubprogram(name: "Swift runtime failure: arithmetic overflow"