Files
swift-mirror/test/Sema/availability_define_multi_file.swift
Alexis Laferrière ff803c6df1 Sema: Move the availability macros cache to the ASTContext
The availability macros definitions are parsed from the command line and
stored in a cache. The cache was in the Parser, which would have it be
computed for each file using availability macros. Let's move it to the
ASTContext instead where it can generally be computed once per invocation
and used across the module.

rdar://134797088
2024-10-01 09:07:56 -07:00

24 lines
671 B
Swift

// RUN: %empty-directory(%t)
// RUN: split-file %s %t --leading-lines
// RUN: not %target-swift-frontend -typecheck -diagnostic-style llvm \
// RUN: %t/FileA.swift %t/FileB.swift \
// RUN: -define-availability "_justAName" \
// RUN: 2>&1 | %FileCheck %s
// CHECK: -define-availability argument:1:11: error: expected ':' after '_justAName' in availability macro definition
// CHECK-NEXT: _justAName
/// It's parsed once so the diagnostic is produced once as well.
// CHECK-NOT: _justAName
//--- FileA.swift
@available(_triggerParsingMacros)
public func brokenPlatforms() {}
//--- FileB.swift
@available(_triggerParsingMacros)
public func brokenPlatforms() {}