From cfbdae586d3942f88ea651b0353f88dc368dfa35 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Wed, 29 Mar 2023 10:57:18 -0700 Subject: [PATCH] [Macros] Add a test ensuring that we print expanded macro definitions This should complete the implementation of expanded macro definitions, rdar://104044325. --- test/ModuleInterface/macros.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/ModuleInterface/macros.swift b/test/ModuleInterface/macros.swift index 9d9f53fc0d4..74bc73b954c 100644 --- a/test/ModuleInterface/macros.swift +++ b/test/ModuleInterface/macros.swift @@ -15,6 +15,11 @@ // CHECK-NEXT: #endif @freestanding(expression) public macro publicStringify(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro") +@freestanding(expression) public macro labeledStringify(_ value: T, label: String) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro") + +// CHECK: @freestanding(expression) public macro unlabeledStringify(_ value: T, label: Swift.String) -> (T, Swift.String) = #labeledStringify(value, label: "default label") +@freestanding(expression) public macro unlabeledStringify(_ 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 = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral