mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Macros] Add a test ensuring that we print expanded macro definitions
This should complete the implementation of expanded macro definitions, rdar://104044325.
This commit is contained in:
@@ -15,6 +15,11 @@
|
||||
// CHECK-NEXT: #endif
|
||||
@freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
|
||||
@freestanding(expression) public macro labeledStringify<T>(_ value: T, label: String) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
|
||||
// CHECK: @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #labeledStringify(value, label: "default label")
|
||||
@freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: String) -> (T, String) = #labeledStringify(value, label: "default label")
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $Macros
|
||||
// CHECK-NEXT: #if $FreestandingExpressionMacros
|
||||
// CHECK: @freestanding(expression) public macro publicLine<T>() -> T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral
|
||||
|
||||
Reference in New Issue
Block a user