ModuleDebugInfo.cpp 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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-SAME: identifier: "_ZTS11TypedefEnum")
  27. // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
  28. // CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
  29. // CHECK: !DICompositeType(tag: DW_TAG_class_type,
  30. // CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
  31. // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
  32. // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
  33. // CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
  34. // CHECK: !DICompositeType(tag: DW_TAG_class_type,
  35. // CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
  36. // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
  37. // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdVirtual"
  38. // CHECK-SAME: elements:
  39. // CHECK-SAME: identifier: "_ZTS10FwdVirtual")
  40. // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$FwdVirtual"
  41. // CHECK: !DICompositeType(tag: DW_TAG_union_type,
  42. // CHECK-SAME-NOT: name:
  43. // CHECK-SAME: identifier: "_ZTS12TypedefUnion")
  44. // CHECK: !DICompositeType(tag: DW_TAG_structure_type,
  45. // CHECK-SAME-NOT: name:
  46. // CHECK-SAME: identifier: "_ZTS13TypedefStruct")
  47. // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"
  48. // no mangled name here yet.
  49. // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
  50. // no mangled name here yet.
  51. // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"