|
9 | 9 | // RUN: %FileCheck %s < %t/Macros.swiftinterface --check-prefix CHECK |
10 | 10 | // RUN: %target-swift-frontend -compile-module-from-interface %t/Macros.swiftinterface -o %t/Macros.swiftmodule |
11 | 11 |
|
12 | | -// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
13 | | -// CHECK-NEXT: @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "MacroDefinition", type: "StringifyMacro") |
14 | | -// CHECK-NEXT: #endif |
| 12 | +// CHECK: @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "MacroDefinition", type: "StringifyMacro") |
15 | 13 | @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "MacroDefinition", type: "StringifyMacro") |
16 | 14 |
|
17 | | -// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
18 | 15 | // CHECK: @freestanding(expression) public macro labeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #externalMacro(module: "MacroDefinition", type: "StringifyMacro") |
19 | | -// CHECK-NEXT: #endif |
20 | 16 | @freestanding(expression) public macro labeledStringify<T>(_ value: T, label: String) -> (T, String) = #externalMacro(module: "MacroDefinition", type: "StringifyMacro") |
21 | 17 |
|
22 | | -// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
23 | 18 | // CHECK: @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #labeledStringify(value, label: "default label") |
24 | | -// CHECK-NEXT: #endif |
25 | 19 | @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: String) -> (T, String) = #labeledStringify(value, label: "default label") |
26 | 20 |
|
27 | | -// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
28 | 21 | // CHECK: @freestanding(expression) public macro publicLine<T>() -> T = #externalMacro(module: "MacroDefinition", type: "Line") where T : Swift.ExpressibleByIntegerLiteral |
29 | | -// CHECK-NEXT: #endif |
30 | 22 | @freestanding(expression) public macro publicLine<T: ExpressibleByIntegerLiteral>() -> T = #externalMacro(module: "MacroDefinition", type: "Line") |
31 | 23 |
|
32 | | -// CHECK: #if compiler(>=5.3) && $Macros |
33 | 24 | // CHECK: @attached(accessor) public macro myWrapper() = #externalMacro(module: "MacroDefinition", type: "Wrapper") |
34 | | -// CHECK-NEXT: #endif |
35 | 25 | @attached(accessor) public macro myWrapper() = #externalMacro(module: "MacroDefinition", type: "Wrapper") |
36 | 26 |
|
37 | | -// CHECK: #if compiler(>=5.3) && $Macros && $AttachedMacros |
38 | 27 | // CHECK: @attached(member, names: named(init), prefixed(`$`)) public macro MemberwiseInit() = #externalMacro(module: "MacroDefinition", type: "MemberwiseInitMacro") |
39 | | -// CHECK-NEXT: #endif |
40 | 28 | @attached(member, names: named(init), prefixed(`$`)) public macro MemberwiseInit() = #externalMacro(module: "MacroDefinition", type: "MemberwiseInitMacro") |
41 | 29 |
|
42 | | -// CHECK: #if compiler(>=5.3) && $Macros && $AttachedMacros |
43 | 30 | // CHECK: @attached(member, names: named(`init`), prefixed(`$`)) public macro MemberwiseInitFunc() = #externalMacro(module: "MacroDefinition", type: "MemberwiseInitFuncMacro") |
44 | | -// CHECK-NEXT: #endif |
45 | 31 | @attached(member, names: named(`init`), prefixed(`$`)) public macro MemberwiseInitFunc() = #externalMacro(module: "MacroDefinition", type: "MemberwiseInitFuncMacro") |
46 | 32 |
|
47 | | -// CHECK: #if compiler(>=5.3) && $Macros && $AttachedMacros |
48 | 33 | // CHECK: @attached(accessor, names: named(init)) public macro AccessorInitFunc() = #externalMacro(module: "MacroDefinition", type: "AccessorInitFuncMacro") |
49 | | -// CHECK-NEXT: #endif |
50 | 34 | @attached(accessor, names: named(init)) public macro AccessorInitFunc() = #externalMacro(module: "MacroDefinition", type: "AccessorInitFuncMacro") |
51 | 35 |
|
52 | | -// CHECK: #if compiler(>=5.3) && $Macros && $AttachedMacros |
53 | 36 | // CHECK: @attached(extension, conformances: Swift.Sendable) @attached(member) public macro AddSendable() = #externalMacro(module: "MacroDefinition", type: "SendableExtensionMacro") |
54 | | -// CHECK-NEXT: #else |
55 | | -// CHECK: @attached(member) public macro AddSendable() = #externalMacro(module: "MacroDefinition", type: "SendableExtensionMacro") |
56 | | -// CHECK-NEXT: #endif |
57 | 37 | @attached(extension, conformances: Sendable) @attached(member) public macro AddSendable() = #externalMacro(module: "MacroDefinition", type: "SendableExtensionMacro") |
58 | 38 |
|
59 | 39 | // CHECK-NOT: internalStringify |
|
0 commit comments