Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 1 | // 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 |
NAKAMURA Takumi | 0981f73 | 2015-09-08 22:47:32 +0000 | [diff] [blame] | 8 | // RUN: %clang_cc1 -triple %itanium_abi_triple -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 |
Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 9 | // RUN: cat %t-mod.ll | FileCheck %s |
Adrian Prantl | 54a3457 | 2015-09-10 17:13:31 +0000 | [diff] [blame] | 10 | // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s |
Adrian Prantl | a5206ce | 2015-09-22 23:26:43 +0000 | [diff] [blame^] | 11 | // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-DWO %s |
Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 12 | |
| 13 | // PCH: |
NAKAMURA Takumi | 0981f73 | 2015-09-08 22:47:32 +0000 | [diff] [blame] | 14 | // 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 |
Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 15 | // RUN: cat %t-pch.ll | FileCheck %s |
Adrian Prantl | 54a3457 | 2015-09-10 17:13:31 +0000 | [diff] [blame] | 16 | // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s |
Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 17 | |
| 18 | #ifdef MODULES |
| 19 | @import DebugCXX; |
| 20 | #endif |
| 21 | |
| 22 | // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, |
| 23 | // CHECK-SAME: isOptimized: false, |
Adrian Prantl | a5206ce | 2015-09-22 23:26:43 +0000 | [diff] [blame^] | 24 | // CHECK-SAME-NOT: splitDebugFilename: |
| 25 | // CHECK-DWO: dwoId: |
Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 26 | // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum" |
| 27 | // CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE") |
| 28 | // CHECK: !DINamespace(name: "DebugCXX" |
| 29 | // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct" |
| 30 | // CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE") |
| 31 | // CHECK: !DICompositeType(tag: DW_TAG_class_type, |
| 32 | // CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >" |
| 33 | // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") |
| 34 | // CHECK: !DICompositeType(tag: DW_TAG_class_type, |
| 35 | // CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >" |
| 36 | // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE") |
Adrian Prantl | 4aa2b3a | 2015-09-08 19:20:27 +0000 | [diff] [blame] | 37 | // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>" |
| 38 | // CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE") |
| 39 | // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation" |
| 40 | // no mangled name here yet. |
| 41 | // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B", |
| 42 | // no mangled name here yet. |
Adrian Prantl | 54a3457 | 2015-09-10 17:13:31 +0000 | [diff] [blame] | 43 | |
| 44 | // CHECK-NEG-NOT: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE" |