mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
13 lines
510 B
Swift
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() {}
|
|
}
|