ModuleDebugInfo.cpp 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Test that (the same) debug info is emitted for an Objective-C++
  2. // module and a C++ precompiled header.
  3. // REQUIRES: asserts, shell
  4. // Modules:
  5. // RUN: rm -rf %t
  6. // RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll
  7. // RUN: cat %t-mod.ll | FileCheck %s
  8. // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s
  9. // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-DWO %s
  10. // PCH:
  11. // RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
  12. // RUN: cat %t-pch.ll | FileCheck %s
  13. // RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s
  14. #ifdef MODULES
  15. @import DebugCXX;
  16. #endif
  17. // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
  18. // CHECK-SAME: isOptimized: false,
  19. // CHECK-SAME-NOT: splitDebugFilename:
  20. // CHECK-DWO: dwoId:
  21. // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum"
  22. // CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE")
  23. // CHECK: !DINamespace(name: "DebugCXX"
  24. // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
  25. // CHECK-SAME-NOT: name:
  26. // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
  27. // CHECK-SAME-NOT: name:
  28. // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
  29. // CHECK-SAME-NOT: name:
  30. // CHECK-SAME: identifier: "_ZTS11TypedefEnum")
  31. // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
  32. // CHECK-SAME-NOT: name:
  33. // CHECK: !DIEnumerator(name: "e5", value: 5)
  34. // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
  35. // CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
  36. // CHECK: !DICompositeType(tag: DW_TAG_class_type,
  37. // CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
  38. // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
  39. // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
  40. // CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
  41. // CHECK: !DICompositeType(tag: DW_TAG_class_type,
  42. // CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
  43. // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
  44. // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdVirtual"
  45. // CHECK-SAME: elements:
  46. // CHECK-SAME: identifier: "_ZTS10FwdVirtual")
  47. // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$FwdVirtual"
  48. // CHECK: !DICompositeType(tag: DW_TAG_union_type,
  49. // CHECK-SAME-NOT: name:
  50. // CHECK-SAME: identifier: "_ZTS12TypedefUnion")
  51. // CHECK: !DICompositeType(tag: DW_TAG_structure_type,
  52. // CHECK-SAME-NOT: name:
  53. // CHECK-SAME: identifier: "_ZTS13TypedefStruct")
  54. // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"
  55. // no mangled name here yet.
  56. // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
  57. // no mangled name here yet.
  58. // CHECK: !DICompositeType(tag: DW_TAG_union_type,
  59. // CHECK-SAME-NOT: name:
  60. // CHECK: !DICompositeType(tag: DW_TAG_structure_type,
  61. // CHECK-SAME-NOT: name:
  62. // CHECK: !DICompositeType(tag: DW_TAG_structure_type,
  63. // CHECK-SAME: name: "InAnonymousNamespace",
  64. // CHECK-SAME: elements: !{{[0-9]+}})
  65. // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"