mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* 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
19 lines
387 B
Swift
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
|