blob: 4a0e69a27aee81c67579ca1897be037a571701a3 [file] [log] [blame]
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +00001// Test that (the same) debug info is emitted for an Objective-C++
2// module and a C++ precompiled header.
3
4// REQUIRES: asserts, shell
5
6// Modules:
7// RUN: rm -rf %t
8// RUN: %clang_cc1 -x objective-c++ -std=c++11 -g -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
9// RUN: cat %t-mod.ll | FileCheck %s
10
11// PCH:
12// RUN: %clang_cc1 -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
13// RUN: cat %t-pch.ll | FileCheck %s
14
15#ifdef MODULES
16@import DebugCXX;
17#endif
18
19// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
20// CHECK-SAME: isOptimized: false,
21// CHECK-SAME: splitDebugFilename:
22// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum"
23// CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE")
24// CHECK: !DINamespace(name: "DebugCXX"
25// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
26// CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
27// CHECK: !DICompositeType(tag: DW_TAG_class_type,
28// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
29// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
30// CHECK: !DICompositeType(tag: DW_TAG_class_type,
31// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
32// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
33// CHECK: !DICompositeType(tag: DW_TAG_class_type,
34// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >"
35// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE")
36// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
37// CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
38// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"
39// no mangled name here yet.
40// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
41// no mangled name here yet.