mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The SIL generation for this builtin also changes: instead of generating the cond_fail instructions upfront, let the optimizer generate it, if the operand is a static string literal. In worst case, if the second operand is not a static string literal, the Builtin.condfail is lowered at the end of the optimization pipeline with a default message: "unknown program error".
15 lines
535 B
Swift
15 lines
535 B
Swift
// REQUIRES: optimized_stdlib
|
|
|
|
// RUN: %target-swift-frontend -emit-sil -o /dev/null \
|
|
// RUN: %s -Xllvm -sil-print-debuginfo -Onone -sil-verify-all \
|
|
// RUN: -Xllvm -sil-print-after=diagnostic-constant-propagation \
|
|
// RUN: 2>&1 | %FileCheck %s
|
|
|
|
// CHECK: alloc_stack $R, loc {{.*}}, scope 2
|
|
// CHECK-NEXT: init_existential_addr {{.*}} : $*R, $Float, loc {{.*}}, scope 2
|
|
// CHECK-NEXT: copy_addr [take] %8 to [initialization] {{.*}} : $*Float, loc {{.*}}, scope 2
|
|
|
|
protocol R {}
|
|
extension Float: R {}
|
|
print(1.0 as Float? as! R)
|