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
|
|
|
|
|
|
|
|
// PCH:
|
|
|
|
// RUN: %clang_cc1 -x objective-c -fmodule-format=obj -emit-pch -I%S/Inputs \
|
|
|
|
// RUN: -o %t.pch %S/Inputs/DebugObjC.h
|
2015-10-08 12:24:12 +08:00
|
|
|
// RUN: %clang_cc1 -x objective-c -debug-info-kind=limited -dwarf-ext-refs -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
|
|
|
|
|
|
|
|
#ifdef MODULES
|
|
|
|
@import DebugObjC;
|
|
|
|
#endif
|
|
|
|
|
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];
|
|
|
|
}
|
|
|
|
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK: !DIGlobalVariable(name: "GlobalUnion",
|
|
|
|
// CHECK-SAME: type: ![[GLOBAL_UNION:[0-9]+]]
|
2016-04-15 23:55:45 +08:00
|
|
|
// CHECK: ![[MOD:.*]] = !DIModule(scope: null, name: "DebugObjC
|
2016-01-20 07:42:56 +08:00
|
|
|
// CHECK: ![[GLOBAL_UNION]] = !DICompositeType(tag: DW_TAG_union_type,
|
|
|
|
// 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]+]]
|
|
|
|
// CHECK: ![[GLOBAL_STRUCT]] = !DICompositeType(tag: DW_TAG_structure_type,
|
|
|
|
// CHECK-SAME: elements: !{{[0-9]+}})
|
|
|
|
|
|
|
|
// 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
|
|
|
|
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-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)
|