Files
swift-mirror/test/SourceKit/ActiveRegions/nested2.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

20 lines
420 B
Swift

func foo() -> Int {
#if true
#if true
return 1
#else
return 2
#endif
#else
return 3
#endif
}
// RUN: %sourcekitd-test -req=active-regions %s -- -D FLAG_1 -module-name active_regions %s | %FileCheck -check-prefix=CHECK1 %s
// CHECK1: START IF CONFIGS
// CHECK1-NEXT: 2:3 - active
// CHECK1-NEXT: 3:3 - active
// CHECK1-NEXT: 5:3 - inactive
// CHECK1-NEXT: 8:3 - inactive
// CHECK1-NEXT: END IF CONFIGS