- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathfine_grained_dependencies.swift
19 lines (14 loc) · 812 Bytes
/
fine_grained_dependencies.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// REQUIRES: swift_swift_parser, executable_test
// RUN: %empty-directory(%t)
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift
// RUN: %target-swift-frontend -typecheck -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -module-name MacroUser -parse-as-library -emit-reference-dependencies-path %t/MacroUser.swiftdeps -primary-file %s
// Note: this test ensures that we don't crash when trying to mangle a symbol
// within a closure passed to a macro.
@freestanding(declaration)
macro Empty<T>(_ x:T)= #externalMacro(module:"MacroDefinition", type:"EmptyDeclarationMacro")
#Empty {
structS{
staticvarfoo:Int{0}
}
_ =S.foo
}