Files
swift-mirror/test/SourceKit/ActiveRegions/postfix.swift
Rintaro Ishizaki 2abddcb260 [SourceKit] Use recored #if regions in "active regions" request
* Record each IfConfig clause location info in SourceFile
* Update SILProfiler to handle them
* Update SwiftLangSupport::findActiveRegionsInFile() to use the recorded
  regions instead of walking into AST to find #if regions

rdar://118082146
2024-03-14 08:52:57 +09:00

19 lines
387 B
Swift

struct Value {
var prop1: Int = 0
var prop2: Int = 0
}
func test(value: Value) {
let _ = value
#if false
.prop1
#else
.prop2
#endif
}
// RUN: %sourcekitd-test -req=active-regions %s -- -module-name active_regions %s | %FileCheck -check-prefix=CHECK1 %s
// CHECK1: START IF CONFIGS
// CHECK1-NEXT: 7:1 - inactive
// CHECK1-NEXT: 9:1 - active
// CHECK1-NEXT: END IF CONFIGS