Files
swift-mirror/test/SILOptimizer/castoptimizer-wrongscope.swift
Adrian Prantl 4174e2136f Remove the redundant lexical scope for function-body brace statements.
Before this patch every Swift function would contain a top-level
DW_TAG_lexical_scope that didn't provide any useful information, used extra
space in the debug info and prevented local variables from showing up in virtual
async backtraces.
2021-02-26 13:53:30 -08:00

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 1
// CHECK-NEXT: init_existential_addr {{.*}} : $*R, $Float, loc {{.*}}, scope 1
// CHECK-NEXT: copy_addr [take] %8 to [initialization] {{.*}} : $*Float, loc {{.*}}, scope 1
protocol R {}
extension Float: R {}
print(1.0 as Float? as! R)