[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:
Rintaro Ishizaki
2023-10-23 14:15:52 -07:00
parent 03bf349778
commit 55144fb302
3 changed files with 42 additions and 3 deletions

View File

@@ -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
}