diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-09-22 22:20:50 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-09-22 22:20:50 +0000 |
commit | e5162dba49890d9d436ea99d003c792897c9b880 (patch) | |
tree | 7ea0649b1f3bace01aba3cbfd2b627b30a6f51fe /llvm/test | |
parent | 0a9466c11ecf190ac8408f71f27c188a4bbb843c (diff) | |
download | bcm5719-llvm-e5162dba49890d9d436ea99d003c792897c9b880.tar.gz bcm5719-llvm-e5162dba49890d9d436ea99d003c792897c9b880.zip |
dsymutil: Follow references to clang modules and recursively clone the
debug info.
This does not yet resolve external type references.
llvm-svn: 248331
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/modules/1.o | bin | 0 -> 2392 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/modules/Bar.pcm | bin | 0 -> 25520 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/modules/Foo.pcm | bin | 0 -> 25448 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/X86/lit.local.cfg | 2 | ||||
-rw-r--r-- | llvm/test/tools/dsymutil/X86/modules.m | 62 |
5 files changed, 63 insertions, 1 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/modules/1.o b/llvm/test/tools/dsymutil/Inputs/modules/1.o Binary files differnew file mode 100644 index 00000000000..6e0775f5755 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/modules/1.o diff --git a/llvm/test/tools/dsymutil/Inputs/modules/Bar.pcm b/llvm/test/tools/dsymutil/Inputs/modules/Bar.pcm Binary files differnew file mode 100644 index 00000000000..8b628e3cf01 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/modules/Bar.pcm diff --git a/llvm/test/tools/dsymutil/Inputs/modules/Foo.pcm b/llvm/test/tools/dsymutil/Inputs/modules/Foo.pcm Binary files differnew file mode 100644 index 00000000000..2416a405443 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/modules/Foo.pcm diff --git a/llvm/test/tools/dsymutil/X86/lit.local.cfg b/llvm/test/tools/dsymutil/X86/lit.local.cfg index ed9eba0b0d9..05f8b38b334 100644 --- a/llvm/test/tools/dsymutil/X86/lit.local.cfg +++ b/llvm/test/tools/dsymutil/X86/lit.local.cfg @@ -1,4 +1,4 @@ if not 'X86' in config.root.targets: config.unsupported = True -config.suffixes = ['.test', '.cpp', '.s'] +config.suffixes = ['.test', '.cpp', '.m', '.s'] diff --git a/llvm/test/tools/dsymutil/X86/modules.m b/llvm/test/tools/dsymutil/X86/modules.m new file mode 100644 index 00000000000..6a93f28587a --- /dev/null +++ b/llvm/test/tools/dsymutil/X86/modules.m @@ -0,0 +1,62 @@ +/* Compile with: + cat >modules.modulemap <<EOF + module Foo { + header "Foo.h" + export * + } + module Bar { + header "Bar.h" + export * + } + EOF + clang -D BAR_H -E -o Bar.h + clang -D FOO_H -E -o Foo.h + clang -cc1 -emit-obj -fmodules -fmodule-map-file=modules.modulemap \ + -fmodule-format=obj -g -dwarf-ext-refs -fmodules-cache-path=. \ + -fdisable-module-hash modules.m -o 1.o +*/ + +// RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/modules \ +// RUN: -y %p/dummy-debug-map.map -o - \ +// RUN: | llvm-dwarfdump --debug-dump=info - | FileCheck %s + +// --------------------------------------------------------------------- +#ifdef BAR_H +// --------------------------------------------------------------------- +// CHECK: DW_TAG_compile_unit +// CHECK: DW_TAG_module +// CHECK-NEXT: DW_AT_name {{.*}}"Bar" +// CHECK: DW_TAG_member +// CHECK: DW_AT_name {{.*}}"value" + +struct Bar { + int value; +}; + +#else +// --------------------------------------------------------------------- +#ifdef FOO_H +// --------------------------------------------------------------------- +// CHECK: 55{{.*}}DW_TAG_compile_unit +// CHECK: DW_TAG_module +// CHECK-NEXT: DW_AT_name {{.*}}"Foo" +// CHECK: DW_TAG_typedef +@import Bar; +typedef struct Bar Bar; +struct S {}; + +// --------------------------------------------------------------------- +#else +// --------------------------------------------------------------------- + +// CHECK: DW_TAG_compile_unit +// CHECK: DW_TAG_subprogram +// CHECK: DW_AT_name {{.*}}"main" +@import Foo; +int main(int argc, char **argv) { + Bar bar; + bar.value = 42; + return bar.value; +} +#endif +#endif |