|
5 | 5 |
|
6 | 6 | // RUN: %empty-directory(%t)
|
7 | 7 |
|
8 |
| -// RUN: %target-swift-frontend -typecheck -module-name Macros -emit-module-interface-path %t/Macros.swiftinterface %s |
| 8 | +// RUN: %target-swift-emit-module-interface(%t/Macros.swiftinterface) -module-name Macros %s |
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 |
13 |
| -// CHECK-NEXT: #if $FreestandingExpressionMacros |
| 12 | +// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
14 | 13 | // CHECK-NEXT: @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
15 |
| -// CHECK-NEXT: #else |
16 |
| -// CHECK-NEXT: @expression public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro") |
17 |
| -// CHECK-NEXT: #endif |
18 | 14 | // CHECK-NEXT: #endif
|
19 | 15 | @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
20 | 16 |
|
| 17 | +// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
| 18 | +// CHECK: @freestanding(expression) public macro labeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro") |
| 19 | +// CHECK-NEXT: #endif |
21 | 20 | @freestanding(expression) public macro labeledStringify<T>(_ value: T, label: String) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
22 | 21 |
|
| 22 | +// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
23 | 23 | // CHECK: @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #labeledStringify(value, label: "default label")
|
| 24 | +// CHECK-NEXT: #endif |
24 | 25 | @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: String) -> (T, String) = #labeledStringify(value, label: "default label")
|
25 | 26 |
|
26 |
| -// CHECK: #if compiler(>=5.3) && $Macros |
27 |
| -// CHECK-NEXT: #if $FreestandingExpressionMacros |
| 27 | +// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros |
28 | 28 | // CHECK: @freestanding(expression) public macro publicLine<T>() -> T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral
|
29 |
| -// CHECK-NEXT: #else |
30 |
| -// CHECK: @expression public macro publicLine<T>() -> T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral |
31 |
| -// CHECK-NEXT: #endif |
32 | 29 | // CHECK-NEXT: #endif
|
33 | 30 | @freestanding(expression) public macro publicLine<T: ExpressibleByIntegerLiteral>() -> T = #externalMacro(module: "SomeModule", type: "Line")
|
34 | 31 |
|
|
0 commit comments