1// Test that debug info is emitted for an Objective-C module and 2// a precompiled header. 3 4// REQUIRES: asserts, shell 5 6// Modules: 7// RUN: rm -rf %t 8// RUN: %clang_cc1 -x objective-c -fmodules -fmodule-format=obj \ 9// RUN: -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s \ 10// RUN: -I %S/Inputs -I %t -emit-llvm -o %t.ll \ 11// RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll 12// RUN: cat %t-mod.ll | FileCheck %s 13// RUN: cat %t-mod.ll | FileCheck %s --check-prefix=MODULE-CHECK 14 15// PCH: 16// RUN: %clang_cc1 -x objective-c -emit-pch -fmodule-format=obj -I %S/Inputs \ 17// RUN: -o %t.pch %S/Inputs/DebugObjC.h \ 18// RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll 19// RUN: cat %t-pch.ll | FileCheck %s 20 21#ifdef MODULES 22@import DebugObjC; 23#endif 24 25// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC 26// CHECK-SAME: isOptimized: false, 27// CHECK: !DICompositeType(tag: DW_TAG_structure_type, 28// CHECK-SAME: name: "FwdDecl", 29// CHECK: !DICompositeType(tag: DW_TAG_structure_type, 30// CHECK-SAME: name: "ObjCClass", 31// CHECK: !DIObjCProperty(name: "property", 32// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "ivar" 33// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "InnerEnum" 34// CHECK: !DISubprogram(name: "+[ObjCClass classMethod]" 35// CHECK: !DISubprogram(name: "-[ObjCClass instanceMethodWithInt:]" 36// CHECK: !DISubprogram(name: "-[Category(Category) categoryMethod]" 37 38// MODULE-CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, 39// MODULE-CHECK-SAME: scope: ![[MODULE:[0-9]+]], 40// MODULE-CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC" 41// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, 42// MODULE-CHECK-SAME: name: "FwdDecl", 43// MODULE-CHECK-SAME: scope: ![[MODULE]], 44// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, 45// MODULE-CHECK-SAME: name: "ObjCClass", 46// MODULE-CHECK-SAME: scope: ![[MODULE]], 47// MODULE-CHECK: !DISubprogram(name: "+[ObjCClass classMethod]", 48// MODULE-CHECK-SAME: scope: ![[MODULE]], 49 50// The forward declaration should not be in the module scope. 51// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file 52