Files
swift-mirror/test/DebugInfo/implicit_variable.swift
Min-Yih Hsu e63632fda8 [DebugInfo][SIL] Introduce the 'implicit' attribute for debug variable
Debug variables that are marked 'implicit' on its `debug_value`
instruction mean that they were generated by compiler. Optimizers are
free to remove them (if it becomes a dead code, for instance) even in
-Onone. Since they are barely used by users and keeping them might lead
to incorrect IRGen results.
2021-08-04 12:56:35 -07:00

13 lines
510 B
Swift

// RUN: %target-swift-frontend -emit-sil -g %s -o %t.sil
// RUN: %FileCheck %s --input-file=%t.sil
// Test the SILParser / SILPrinter
// RUN: %target-swift-frontend -module-name ImplicitVar -emit-sil -g %t.sil | %FileCheck %s
struct MyStruct {
// Check if the 'implicit' directive for `self` is properly generated (and parsed)
// CHECK: sil {{.*}} @{{.*}}MyStructV5hello
// CHECK: debug_value %0 : $MyStruct
// CHECK-SAME: let, name "self", argno 1, implicit, loc
func hello() {}
}