2015-09-12 01:23:08 +08:00
|
|
|
// RUN: rm -rf %t
|
2015-09-12 02:54:34 +08:00
|
|
|
// Test that only forward declarations are emitted for types defined in modules.
|
2015-09-12 01:23:08 +08:00
|
|
|
|
|
|
|
// Modules:
|
2015-10-08 12:24:12 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c -debug-info-kind=limited -dwarf-ext-refs -fmodules \
|
2015-09-12 01:23:08 +08:00
|
|
|
// RUN: -fmodule-format=obj -fimplicit-module-maps -DMODULES \
|
|
|
|
// RUN: -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t-mod.ll
|
|
|
|
// RUN: cat %t-mod.ll | FileCheck %s
|
2020-03-21 05:17:32 +08:00
|
|
|
// RUN: cat %t-mod.ll | FileCheck %s --check-prefix=DWOID
|
2015-09-12 01:23:08 +08:00
|
|
|
|
|
|
|
// PCH:
|
|
|
|
// RUN: %clang_cc1 -x objective-c -fmodule-format=obj -emit-pch -I%S/Inputs \
|
|
|
|
// RUN: -o %t.pch %S/Inputs/DebugObjC.h
|
2020-03-21 05:17:32 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c -debug-info-kind=limited -dwarf-ext-refs \
|
|
|
|
// RUN: -fmodule-format=obj \
|
2015-09-12 01:23:08 +08:00
|
|
|
// RUN: -include-pch %t.pch %s -emit-llvm -o %t-pch.ll %s
|
|
|
|
// RUN: cat %t-pch.ll | FileCheck %s
|
2020-03-21 05:17:32 +08:00
|
|
|
// RUN: cat %t-pch.ll | FileCheck %s --check-prefix=DWOID
|
2015-09-12 01:23:08 +08:00
|
|
|
|
|
|
|
#ifdef MODULES
|
|
|
|
@import DebugObjC;
|
|
|
|
#endif
|
|
|
|
|
2016-04-21 07:59:32 +08:00
|
|
|
@implementation ObjCClassWithPrivateIVars {
|
|
|
|
int hidden_ivar;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2016-01-20 07:42:56 +08:00
|
|
|
TypedefUnion tdu;
|
|
|
|
TypedefEnum tde;
|
|
|
|
TypedefStruct tds;
|
|
|
|
|
2015-09-12 01:23:08 +08:00
|
|
|
int foo(ObjCClass *c) {
|
2015-10-24 01:02:22 +08:00
|
|
|
InnerEnum e = e0;
|
2016-01-20 07:42:56 +08:00
|
|
|
GlobalStruct.i = GlobalUnion.i = GlobalEnum;
|
2015-09-12 01:23:08 +08:00
|
|
|
[c instanceMethodWithInt: 0];
|
|
|
|
return [c property];
|
|
|
|
}
|
|
|
|
|
2020-03-21 05:17:32 +08:00
|
|
|
// DWOID: !DICompileUnit(language: DW_LANG_ObjC,{{.*}}isOptimized: false,{{.*}}dwoId:
|
|
|
|
|
2016-04-21 07:59:32 +08:00
|
|
|
// CHECK: ![[MOD:.*]] = !DIModule(scope: null, name: "DebugObjC
|
|
|
|
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK: !DIGlobalVariable(name: "GlobalUnion",
|
|
|
|
// CHECK-SAME: type: ![[GLOBAL_UNION:[0-9]+]]
|
2016-04-17 15:45:08 +08:00
|
|
|
// CHECK: ![[GLOBAL_UNION]] = distinct !DICompositeType(tag: DW_TAG_union_type,
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK-SAME: elements: !{{[0-9]+}})
|
2016-04-15 23:55:45 +08:00
|
|
|
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK: !DIGlobalVariable(name: "GlobalStruct",
|
|
|
|
// CHECK-SAME: type: ![[GLOBAL_STRUCT:[0-9]+]]
|
2016-04-17 15:45:08 +08:00
|
|
|
// CHECK: ![[GLOBAL_STRUCT]] = distinct !DICompositeType(tag: DW_TAG_structure_type,
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK-SAME: elements: !{{[0-9]+}})
|
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClassWithPrivateIVars",
|
|
|
|
// CHECK-SAME: flags: DIFlagObjcClassComplete
|
|
|
|
|
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "hidden_ivar",
|
|
|
|
// CHECK-SAME: flags: DIFlagPrivate)
|
2016-04-15 23:55:45 +08:00
|
|
|
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefEnum",
|
|
|
|
// CHECK-SAME: baseType: ![[TD_ENUM:.*]])
|
|
|
|
// CHECK: ![[TD_ENUM]] = !DICompositeType(tag: DW_TAG_enumeration_type,
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl)
|
2016-04-15 23:55:45 +08:00
|
|
|
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefStruct",
|
|
|
|
// CHECK-SAME: baseType: ![[TD_STRUCT:.*]])
|
|
|
|
// CHECK: ![[TD_STRUCT]] = !DICompositeType(tag: DW_TAG_structure_type,
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl)
|
|
|
|
|
2016-09-13 09:13:19 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefUnion",
|
|
|
|
// CHECK-SAME: baseType: ![[TD_UNION:.*]])
|
|
|
|
// CHECK: ![[TD_UNION]] = !DICompositeType(tag: DW_TAG_union_type,
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl)
|
|
|
|
|
2016-04-15 23:55:45 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",
|
|
|
|
// CHECK-SAME: scope: ![[MOD]],
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl)
|
|
|
|
|
2015-09-12 02:54:34 +08:00
|
|
|
// CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type,
|
2015-10-24 01:02:22 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
|
|
|
|
// CHECK-SAME: scope: ![[MOD]],
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl)
|