mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Macros] Add test for macro expansion printing
* Macro expanded member decls in .swiftinterface (rdar://117374821) * cursor-info on a decl with peer macro attribute (rdar://117374966)
This commit is contained in:
@@ -64,8 +64,35 @@ macro structWithUnqualifiedLookup() = #externalMacro(module: "MacroDefinition",
|
||||
|
||||
let world = 17
|
||||
|
||||
// CHECK-NOT: structWithUnqualifiedLookup
|
||||
public
|
||||
#structWithUnqualifiedLookup
|
||||
|
||||
// CHECK-NOT: structWithUnqualifiedLookup
|
||||
// CHECK-NOT: struct StructWithUnqualifiedLookup
|
||||
// CHECK: struct StructWithUnqualifiedLookup
|
||||
// CHECK-NOT: struct StructWithUnqualifiedLookup
|
||||
|
||||
@attached(peer, names: named(_foo))
|
||||
macro AddPeerStoredProperty() = #externalMacro(module: "MacroDefinition", type: "AddPeerStoredPropertyMacro")
|
||||
|
||||
@AddPeerStoredProperty
|
||||
public var test: Int = 10
|
||||
// CHECK: var test
|
||||
// CHECK-NOT: var _foo
|
||||
// CHECK: var _foo
|
||||
// CHECK-NOT: var _foo
|
||||
|
||||
// CHECK: struct TestStruct {
|
||||
public struct TestStruct {
|
||||
public #structWithUnqualifiedLookup
|
||||
// CHECK-NOT: structWithUnqualifiedLookup
|
||||
// CHECK-NOT: struct StructWithUnqualifiedLookup
|
||||
// CHECK: struct StructWithUnqualifiedLookup
|
||||
// CHECK-NOT: struct StructWithUnqualifiedLookup
|
||||
|
||||
@AddPeerStoredProperty
|
||||
public var test: Int = 10
|
||||
// CHECK: var test
|
||||
// CHECK-NOT: var _foo
|
||||
// CHECK: var _foo
|
||||
// CHECK-NOT: var _foo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user