Skip to content

Commit b6b7a9e

Browse files
committed
[Macros] Add a test ensuring that we print expanded macro definitions
This should complete the implementation of expanded macro definitions, rdar://104044325.
1 parent 5f644aa commit b6b7a9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/ModuleInterface/macros.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
// CHECK-NEXT: #endif
1616
@freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
1717

18+
@freestanding(expression) public macro labeledStringify<T>(_ value: T, label: String) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
19+
20+
// CHECK: @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #labeledStringify(value, label: "default label")
21+
@freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: String) -> (T, String) = #labeledStringify(value, label: "default label")
22+
1823
// CHECK: #if compiler(>=5.3) && $Macros
1924
// CHECK-NEXT: #if $FreestandingExpressionMacros
2025
// CHECK: @freestanding(expression) public macro publicLine<T>() -> T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral

0 commit comments

Comments
 (0)