llvm/clang/test/AST/property-atomic-bool.m
Bruno Ricci cddc9993ea
[clang][test][NFC] Also test for serialization in AST dump tests, part 3/n.
The outputs between the direct ast-dump test and the ast-dump test after
deserialization should match modulo a few differences.

For hand-written tests, strip the "<undeserialized declarations>"s and
the "imported"s with sed.

For tests generated with "make-ast-dump-check.sh", regenerate the output.

Part 3/n.
2020-06-21 13:59:11 +01:00

70 lines
2.1 KiB
Objective-C

// Test without serialization:
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -ast-dump "%s" \
// RUN: | FileCheck %s
//
// Test with serialization:
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-pch -o %t %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -x objective-c -include-pch %t -ast-dump-all /dev/null \
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
// RUN: | FileCheck %s
// CHECK: TypedefDecl {{.*}} referenced AtomicBool '_Atomic(_Bool)'
// CHECK: AtomicType {{.*}} '_Atomic(_Bool)'
// CHECK: BuiltinType {{.*}} '_Bool'
// CHECK: ObjCInterfaceDecl {{.*}} A0
// CHECK: ObjCPropertyDecl {{.*}} p '_Atomic(_Bool)' {{.*}} nonatomic
// CHECK: ObjCMethodDecl {{.*}} implicit - p '_Bool'
// CHECK: ObjCMethodDecl {{.*}} implicit - setP: 'void'
// CHECK: ParmVarDecl {{.*}} p '_Bool'
// CHECK: ObjCInterfaceDecl {{.*}} A1
// CHECK: ObjCPropertyDecl {{.*}} p 'AtomicBool':'_Atomic(_Bool)' {{.*}} nonatomic
// CHECK: ObjCMethodDecl {{.*}} implicit - p '_Bool'
// CHECK: ObjCMethodDecl {{.*}} implicit - setP: 'void'
// CHECK: ParmVarDecl {{.*}} p '_Bool'
// CHECK: ObjCInterfaceDecl {{.*}} A2
// CHECK: ObjCIvarDecl {{.*}} p '_Atomic(_Bool)' protected
// CHECK: ObjCPropertyDecl {{.*}} p '_Atomic(_Bool)'
// CHECK: ObjCMethodDecl {{.*}} implicit - p '_Bool'
// CHECK: ObjCMethodDecl {{.*}} implicit - setP: 'void'
// CHECK: ParmVarDecl {{.*}} p '_Bool'
// CHECK: ObjCInterfaceDecl {{.*}} A3
// CHECK: ObjCIvarDecl {{.*}} p 'AtomicBool':'_Atomic(_Bool)' protected
// CHECK: ObjCPropertyDecl {{.*}} p 'AtomicBool':'_Atomic(_Bool)'
// CHECK: ObjCMethodDecl {{.*}} implicit - p '_Bool'
// CHECK: ObjCMethodDecl {{.*}} implicit - setP: 'void'
// CHECK: ParmVarDecl {{.*}} p '_Bool'
typedef _Atomic(_Bool) AtomicBool;
@interface A0
@property(nonatomic) _Atomic(_Bool) p;
@end
@implementation A0
@end
@interface A1
@property(nonatomic) AtomicBool p;
@end
@implementation A1
@end
@interface A2 {
_Atomic(_Bool) p;
}
@property _Atomic(_Bool) p;
@end
@implementation A2
@synthesize p;
@end
@interface A3 {
AtomicBool p;
}
@property AtomicBool p;
@end
@implementation A3
@synthesize p;
@end