ModuleDebugInfo.cpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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-DWO %s
  9. // PCH:
  10. // 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
  11. // RUN: cat %t-pch.ll | FileCheck %s
  12. #ifdef MODULES
  13. @import DebugCXX;
  14. #endif
  15. // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
  16. // CHECK-SAME: isOptimized: false,
  17. // CHECK-SAME-NOT: splitDebugFilename:
  18. // CHECK-DWO: dwoId:
  19. // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum"
  20. // CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE")
  21. // CHECK: !DINamespace(name: "DebugCXX"
  22. // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
  23. // CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
  24. // CHECK: !DICompositeType(tag: DW_TAG_class_type,
  25. // CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
  26. // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
  27. // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
  28. // CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
  29. // CHECK: !DICompositeType(tag: DW_TAG_class_type,
  30. // CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
  31. // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
  32. // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdVirtual"
  33. // CHECK-SAME: elements:
  34. // CHECK-SAME: identifier: "_ZTS10FwdVirtual")
  35. // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$FwdVirtual"
  36. // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"
  37. // no mangled name here yet.
  38. // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
  39. // no mangled name here yet.