65 lines · plain
1// RUN: rm -rf %t.cache2// RUN: %clangxx --target=x86_64-apple-macosx -g -gmodules -Wno-objc-root-class \3// RUN: -fmodules -fmodules-cache-path=%t.cache \4// RUN: -c -o %t.o %s -I%S/Inputs5// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck --check-prefix CHECK-ANON-S1 %s6// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck --check-prefix CHECK-ANON-S2 %s7// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck %s8// Verify that the owning module information from DWARF is preserved in the AST.9 10@import A;11 12Typedef t1;13// RUN: lldb-test symbols -dump-clang-ast -find type --language=ObjC++ \14// RUN: -compiler-context 'Module:A,Typedef:Typedef' %t.o \15// RUN: | FileCheck %s --check-prefix=CHECK-TYPEDEF16// CHECK-TYPEDEF: TypedefDecl {{.*}} imported in A Typedef17 18TopLevelStruct s1;19// RUN: lldb-test symbols -dump-clang-ast -find type --language=ObjC++ \20// RUN: -compiler-context 'Module:A,ClassOrStruct:TopLevelStruct' %t.o \21// RUN: | FileCheck %s --check-prefix=CHECK-TOPLEVELSTRUCT22// CHECK-TOPLEVELSTRUCT: CXXRecordDecl {{.*}} imported in A struct TopLevelStruct23// CHECK-TOPLEVELSTRUCT: -FieldDecl {{.*}} in A a 'int'24 25Struct s2;26// CHECK-ANON-S1: CXXRecordDecl {{.*}} imported in A struct27 28StructB s3;29// CHECK-ANON-S2: CXXRecordDecl {{.*}} imported in A.B {{.*}}struct30// CHECK-ANON-S2: -FieldDecl {{.*}} in A.B anon_field_b 'int'31 32Nested s4;33// CHECK-DAG: CXXRecordDecl {{.*}} imported in A struct Nested34// CHECK-DAG: -FieldDecl {{.*}} in A fromb 'StructB'35 36Enum e1;37// CHECK-DAG: EnumDecl {{.*}} imported in A {{.*}} Enum_e38// FIXME: -EnumConstantDecl {{.*}} imported in A a39 40@implementation SomeClass {41 int private_ivar;42}43@synthesize number = private_ivar;44@end45 46SomeClass *obj1;47// RUN: lldb-test symbols -dump-clang-ast -find type --language=ObjC++ \48// RUN: -compiler-context 'Module:A,ClassOrStruct:SomeClass' %t.o \49// RUN: | FileCheck %s --check-prefix=CHECK-OBJC50// CHECK-OBJC: ObjCInterfaceDecl {{.*}} imported in A <undeserialized declarations> SomeClass51// CHECK-OBJC-NEXT: |-ObjCIvarDecl52// CHECK-OBJC-NEXT: |-ObjCMethodDecl 0x[[NUMBER:[0-9a-f]+]]{{.*}} imported in A53// CHECK-OBJC-NEXT: `-ObjCPropertyDecl {{.*}} imported in A number 'int' readonly54// CHECK-OBJC-NEXT: `-getter ObjCMethod 0x[[NUMBER]] 'number'55 56// Template specializations are not yet supported, so they lack the ownership info:57Template<int> t2;58// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct Template59 60Namespace::InNamespace<int> t3;61// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct InNamespace62 63Namespace::AlsoInNamespace<int> t4;64// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A.B struct AlsoInNamespace65