[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:
Doug Gregor
2023-03-29 10:57:18 -07:00
parent 38230b79f9
commit cfbdae586d

View File

@@ -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