diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-07-19 00:09:58 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-07-19 00:09:58 +0000 |
commit | bccfcb990700b1e3434cf594432394131677ddc8 (patch) | |
tree | d6283f949db6df7b8174c11d1a6724654bfc7405 /test/Modules | |
parent | 567034c3127eade5ba521dbe549a5e46365d6502 (diff) |
Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
<rdar://problem/33357889>
https://bugs.llvm.org/show_bug.cgi?id=33822
Differential Revision: https://reviews.llvm.org/D35583
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules')
-rw-r--r-- | test/Modules/DebugInfoTransitiveImport.m | 4 | ||||
-rw-r--r-- | test/Modules/ExtDebugInfo.cpp | 4 | ||||
-rw-r--r-- | test/Modules/Inputs/DebugObjCImport.h | 2 | ||||
-rw-r--r-- | test/Modules/Inputs/module.map | 6 | ||||
-rw-r--r-- | test/Modules/debug-info-moduleimport-in-module.m | 21 | ||||
-rw-r--r-- | test/Modules/debug-info-moduleimport.m | 5 |
6 files changed, 37 insertions, 5 deletions
diff --git a/test/Modules/DebugInfoTransitiveImport.m b/test/Modules/DebugInfoTransitiveImport.m index 034a909333..08dfecfb78 100644 --- a/test/Modules/DebugInfoTransitiveImport.m +++ b/test/Modules/DebugInfoTransitiveImport.m @@ -12,9 +12,9 @@ // Definition of left: // CHECK: !DICompileUnit({{.*}}dwoId: -// CHECK: !DIFile({{.*}}diamond_left +// CHECK: ![[LEFT:[0-9]+]] = !DIFile({{.*}}diamond_left.h // CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, -// CHECK-SAME: entity: ![[MODULE:.*]], line: 3) +// CHECK-SAME: entity: ![[MODULE:.*]], file: ![[LEFT]], line: 3) // CHECK: ![[MODULE]] = !DIModule(scope: null, name: "diamond_top" // Skeleton for top: diff --git a/test/Modules/ExtDebugInfo.cpp b/test/Modules/ExtDebugInfo.cpp index fd3bb94075..ed9d1e859d 100644 --- a/test/Modules/ExtDebugInfo.cpp +++ b/test/Modules/ExtDebugInfo.cpp @@ -71,6 +71,8 @@ void foo() { anon.i = GlobalStruct.i = GlobalUnion.i = GlobalEnum; } +// CHECK: ![[CPP:.*]] = !DIFile(filename: {{.*}}ExtDebugInfo.cpp" + // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum", // CHECK-SAME: scope: ![[NS:[0-9]+]], // CHECK-SAME: flags: DIFlagFwdDecl, @@ -201,7 +203,7 @@ void foo() { // CHECK-SAME: name: "InAnonymousNamespace", {{.*}}DIFlagFwdDecl) -// CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !{{[0-9]+}}, entity: ![[STRUCT]], line: 27) +// CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !{{[0-9]+}}, entity: ![[STRUCT]], file: ![[CPP]], line: 27) // CHECK: !DICompileUnit( // CHECK-SAME: splitDebugFilename: diff --git a/test/Modules/Inputs/DebugObjCImport.h b/test/Modules/Inputs/DebugObjCImport.h new file mode 100644 index 0000000000..b5ef366fca --- /dev/null +++ b/test/Modules/Inputs/DebugObjCImport.h @@ -0,0 +1,2 @@ +@import Empty; +struct DebugObjCImport {}; diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map index c0fe6c557f..4cb3e8a028 100644 --- a/test/Modules/Inputs/module.map +++ b/test/Modules/Inputs/module.map @@ -347,6 +347,12 @@ module DebugObjC { header "DebugObjC.h" } +module DebugObjCImport { + module SubModule { + header "DebugObjCImport.h" + } +} + module ImportNameInDir { header "ImportNameInDir.h" export * diff --git a/test/Modules/debug-info-moduleimport-in-module.m b/test/Modules/debug-info-moduleimport-in-module.m new file mode 100644 index 0000000000..cde46115d2 --- /dev/null +++ b/test/Modules/debug-info-moduleimport-in-module.m @@ -0,0 +1,21 @@ +// Test that an @import inside a module is not represented in the debug info. + +// REQUIRES: asserts + +// RUN: rm -rf %t +// RUN: %clang_cc1 -x objective-c -fmodules -fmodule-format=obj \ +// RUN: -fimplicit-module-maps -fmodules-cache-path=%t %s \ +// RUN: -debugger-tuning=lldb -I %S/Inputs -emit-llvm -o %t.ll \ +// RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll +// RUN: cat %t-mod.ll | FileCheck %s + +@import DebugObjCImport.SubModule; + +// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC +// CHECK: DW_TAG_structure_type, name: "DebugObjCImport" +// CHECK: ![[HEADER:.*]] = !DIFile(filename: {{.*}}DebugObjCImport.h" +// CHECK: ![[SUBMOD:.*]] = !DIModule({{.*}}name: "SubModule" +// CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, +// CHECK-SAME: scope: ![[SUBMOD]], entity: ![[EMPTY:[0-9]+]], +// CHECK-SAME: file: ![[HEADER]], line: 1) +// CHECK: ![[EMPTY]] = !DIModule(scope: null, name: "Empty" diff --git a/test/Modules/debug-info-moduleimport.m b/test/Modules/debug-info-moduleimport.m index bf60690be4..16820baebe 100644 --- a/test/Modules/debug-info-moduleimport.m +++ b/test/Modules/debug-info-moduleimport.m @@ -10,12 +10,13 @@ // CHECK: ![[CU:.*]] = distinct !DICompileUnit @import DebugObjC; // CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: ![[CU]], -// CHECK-SAME: entity: ![[MODULE:.*]], line: [[@LINE-2]]) +// CHECK-SAME: entity: ![[MODULE:.*]], file: ![[F:[0-9]+]], +// CHECK-SAME: line: [[@LINE-3]]) // CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC", // CHECK-SAME: configMacros: "\22-DGREETING=Hello World\22 \22-UNDEBUG\22", // CHECK-SAME: includePath: "{{.*}}test{{.*}}Modules{{.*}}Inputs", // CHECK-SAME: isysroot: "/tmp/..") - +// CHECK: ![[F]] = !DIFile(filename: {{.*}}debug-info-moduleimport.m // RUN: %clang_cc1 -debug-info-kind=limited -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \ // RUN: %s -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm -o - \ |